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

improve error message when incorrectly using cascades #10332

Closed
sigmundch opened this issue Apr 30, 2013 · 8 comments
Closed

improve error message when incorrectly using cascades #10332

sigmundch opened this issue Apr 30, 2013 · 8 comments
Assignees
Labels
analyzer-recovery area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-enhancement A request for a change that isn't a bug

Comments

@sigmundch
Copy link
Member

Consider this program that uses cascades, but that has an error (there is an extra ';' after add(1)):

main() {
  var n = [];
  n..add(1);
   ..add(2);
}

The new analyzer gives a warning. It took me a while to figure out what was wrong in that line of code:

  [warning] Undefined name '' (warning.dart:4:5)

The old analyzer used to say:

  file:.../warning.dart:4:4: Unexpected token '..'
     3: n..add(1);
     4: ..add(2);
           ~~
  file:.../warning.dart:4:6: Unexpected token 'IDENTIFIER' (expected ';')
     3: n..add(1);
     4: ..add(2);
             ~~~
  Compilation failed with 2 problems.

@bwilkerson
Copy link
Member

I hope to get to recovery before M5, but can't make any promises.


Set owner to @bwilkerson.
Added this to the M6 milestone.
Removed Type-Defect label.
Added Type-Enhancement label.

@bwilkerson
Copy link
Member

Removed this from the M6 milestone.
Added this to the M7 milestone.

@jwren
Copy link
Member

jwren commented Sep 19, 2013

M7 -> M8


Removed this from the M7 milestone.
Added this to the M8 milestone.

@bwilkerson
Copy link
Member

Removed this from the M8 milestone.
Added this to the Later milestone.

@bwilkerson
Copy link
Member

Added Analyzer-Recovery label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@bwilkerson
Copy link
Member

I'm not sure when this changed, but we now produce "Expected an identifier". It's not ideal in this case (you'd kind of like "Extra semicolon"), but it does have advantages for code completion, which might outweigh the disadvantages. At least there's only one error message.


Added Fixed label.

@sigmundch sigmundch added Type-Enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-recovery labels Dec 5, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-recovery area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants