Skip to content

Dart2JS parsing miscategorizes tokens around const loop variable #21167

Closed
@eernstg

Description

@eernstg

Dart2JS fails with the compile-time error 'Error: Unexpected token 'x'' at 'for(const int x..' in the following co19 test:

Language/13_Statements/06_For_A01_t11.

Currently, the code should probably be accepted rather than ending in a compile-time error. Issue #5675 may result in a spec change such that it should be a compile-time error. In any case, the parser currently does not treat the given tokens as <modifier> <type> <identifer>, which means that dart2js should be modified both if the code should be accepted and if it should be rejected.

Presumably, the spec will be adjusted, and this ticket can be updated to "make const loop vars a compile-time error".

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions