8000 Poor error message when a keyword is used as an identifier in a library name · Issue #35511 · dart-lang/sdk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Poor error message when a keyword is used as an identifier in a library name #35511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paulyoung opened this issue Dec 28, 2018 · 5 comments
Open
Labels
legacy-area-front-end Legacy: Use area-dart-model instead. model-error-recovery Error recovery in analyzer/CFE. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@paulyoung
Copy link

I created a library with the following name:

library data.void;

I got these errors from dartanalyzer:

Analyzing my-project...
  error • Expected an identifier at lib/src/data/void.dart:1:14 • missing_identifier
  error • Expected to find ';' at lib/src/data/void.dart:1:14 • expected_token
  error • Expected an identifier at lib/src/data/void.dart:1:18 • missing_identifier
3 errors found.

I get no errors if I rename the library:

library data.void_;

I'm using dart 2.1.0 (stable) on macOS High Sierra 10.13.6 (17G3025)

@natebosch
Copy link
Member

The CFE complains too - I think void might be a reserved word and this is not allowed.

@bwilkerson
Copy link
Member

Yes, void is a reserved word, and reserved words cannot be used as identifiers. This is working as intended.

@paulyoung
Copy link
Author

Perhaps the error message could be improved?

@bwilkerson
Copy link
Member

Yes, it could definitely be better.

@bwilkerson bwilkerson reopened this Dec 29, 2018
@bwilkerson bwilkerson changed the title dartanalyzer complains if "void" is used in a library name Poor error message when a keyword is used as an identifier in a library name Dec 29, 2018
@bwilkerson bwilkerson added legacy-area-analyzer Use area-devexp instead. devexp-ux type-enhancement A request for a change that isn't a bug labels Dec 29, 2018
@stereotype441 stereotype441 added the P2 A bug or feature request we're likely to work on label Jan 2, 2019
@srawlins
Copy link
Member

This still reports 3 errors.

@srawlins srawlins added legacy-area-front-end Legacy: Use area-dart-model instead. front-end-fasta-recovery and removed devexp-ux legacy-area-analyzer Use area-devexp instead. labels Jun 15, 2020
@jensjoha jensjoha added P3 A lower priority bug or feature request and removed P2 A bug or feature request we're likely to work on labels Jun 15, 2021
@johnniwinther johnniwinther added model-error-recovery Error recovery in analyzer/CFE. and removed front-end-fasta-recovery labels Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-front-end Legacy: Use area-dart-model instead. model-error-recovery Error recovery in analyzer/CFE. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants
0