Skip to content

Parser doesn't allow "late" as an identifier #38803

@munificent

Description

@munificent

Take this:

main() {
  var foo;
  var bar = foo.late;
}

Run it with:

$ dart --enable-experiment=non-nullable temp.dart

Output:

temp.dart:3:17: Error: Expected an identifier, but got 'late'.
  var bar = foo.late;
                ^^^^

I believe that's incorrect. With NNBD, late is a built-in identifier. It can't be used as an identifier in some contexts (prefix?), but in most places it's a valid identifier, just like get, set, hide, etc.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions