Skip to content

Misleading warning for ?? throw. #24892

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

Closed
lrhn opened this issue Nov 12, 2015 · 2 comments
Closed

Misleading warning for ?? throw. #24892

lrhn opened this issue Nov 12, 2015 · 2 comments
Labels
analyzer-recovery legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@lrhn
Copy link
Member

lrhn commented Nov 12, 2015

The code x ?? throw 0 gives the following errors:

ERROR|SYNTACTIC_ERROR|...file.dart|3|8|Expected to find ';'
ERROR|SYNTACTIC_ERROR|...file.dart|3|8|Expected an identifier

This is misleading since the real solution to the errors is to add parentheses around the throw 0 expression.
Listing what you expect to find is great, but it should be complete then, and '(' is also possible here.

@kevmoo kevmoo added legacy-area-analyzer Use area-devexp instead. devexp-warning Issues with the analyzer's Warning codes labels Nov 12, 2015
@bwilkerson bwilkerson added type-enhancement analyzer-recovery and removed devexp-warning Issues with the analyzer's Warning codes labels Nov 16, 2015
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed Priority-Medium labels Mar 1, 2016
@askeksa-google
Copy link

Will become a duplicate of #24891 when the analyzer integrates with the CFE.

@srawlins
Copy link
Member

srawlins commented Jun 8, 2020

And so it is done. Duplicate of #24891.

@srawlins srawlins closed this as completed Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-recovery legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants