dart2js: Built-in identifier as prefix is not detected as a compile-time error. #28815

Open
eernstg opened this Issue Feb 17, 2017 · 0 comments

Projects

None yet

1 participant

@eernstg
Member
eernstg commented Feb 17, 2017 edited

This is the dart2js specific sub-issue for #28811, which has the details.

dart2js should detect when a built-in identifier is declared as the name of a library prefix, and flag it as a compile-time error.

Usages are generally flagged as compile-time errors (the experiment mentioned in #28811 gives details). This is as specified, cf. the spec change (#28817).

It looks like dart2js treats the built-in identifiers as keywords, so abstract.int v1 = 42; fails because abstract is an unexpected token at that point, but it should be rejected because abstract.int is a type name, and abstract is a built-in identifier, so it cannot occur in a type annotation. So the error message is somewhat confusing, but this is probably not a problem. At least, I cannot think of any programs that should be accepted/rejected where this makes dart2js do the opposite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment