Skip to content
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

Poor recovery when annotations are used where not allowed #22314

Closed
bwilkerson opened this issue Feb 6, 2015 · 2 comments
Closed

Poor recovery when annotations are used where not allowed #22314

bwilkerson opened this issue Feb 6, 2015 · 2 comments
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-fasta-recovery type-enhancement A request for a change that isn't a bug

Comments

@bwilkerson
Copy link
Member

bwilkerson commented Feb 6, 2015

As an example, enter the following into a Dart file:

class EventTarget {
  EventTarget() : _eventsController = new DispatcherController<@nonnull Event>();
}
@bwilkerson bwilkerson added Type-Enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-recovery labels Feb 6, 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 triaged labels Mar 1, 2016
@bwilkerson
Copy link
Member Author

Here is a more complete reproduction case:

const annotation = null;
class A<E> {}
class C {
  m() => new A<@annotation C>();
}

@srawlins srawlins added area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-fasta-recovery and removed P2 A bug or feature request we're likely to work on analyzer-recovery analyzer-ux area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Jun 12, 2020
@srawlins
Copy link
Member

I'm not sure what "poor recovery" meant at the time this bug was filed. Today only one error is issued:

$ dart 22314.dart 
22314.dart:4:16: Error: Unexpected token '@'.
  m() => new A<@annotation C>();
               ^

It could be better messaging ("No annotations here, mate").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. front-end-fasta-recovery type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants