Skip to content

Error message for invalid library name is unclear #36270

Open
@leonsenft

Description

@leonsenft

If a library name in a library directive contains an identifier that begins with a number, the resulting error message is unclear:

library foo.bar.123_baz.qux;
                ^^^^^^^^^^^

Expected to find ';'. [expected_token]

An error message that explains that a library identifier can't begin with a number would be more clear.

An AngularDart client encountered this issue due to their project being hosted under a directory whose name began with a number (which led to the AngularDart compiler emitting this library directive).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestanalyzer-recoveryarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions