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

Better error message for "return" in a lambda #4070

Closed
alan-knight opened this issue Jul 12, 2012 · 12 comments
Closed

Better error message for "return" in a lambda #4070

alan-knight opened this issue Jul 12, 2012 · 12 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

@alan-knight
Copy link
Contributor

I was doing a quick example, changed something from being a regular function to being a simple lambda, and forgot to take out the return statement. So I get a method that looks like
  toString() => return _foo.toString();
and the error message in the editor could be more informative. I get six problems.

A non-abstract method must have a body
Duplicate member 'toString'
Duplicate member 'toString'
Unexpected token '.'
Unexpected token 'IDENTIFIER' (expected ';')
Unexpected token 'return'

The last one is the most useful, but I'd think this is an easy beginner mistake, and we could do better identifying it.

@alan-knight
Copy link
Contributor Author

Added New label.

@madsager
Copy link
Contributor

Added Type-Enhancement, Priority-Medium, Area-Analyzer, Triaged labels.

@clayberg
Copy link

Added this to the Later milestone.

@bwilkerson
Copy link
Member

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

@scheglov
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the Later milestone.
Added AnalysisEngine label.

@DartBot
Copy link

DartBot commented Apr 7, 2013

This comment was originally written by amouravski@google.com


Added Editor-AnalysisEngine label.

@bwilkerson
Copy link
Member

Analysis engine doesn't do very well at this yet either.


Set owner to @bwilkerson.
Removed AnalysisEngine, Editor-AnalysisEngine labels.

@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

Added Started label.

@bwilkerson
Copy link
Member

https://codereview.chromium.org/781133002/ (bleeding edge revision 42143)


Added Fixed label.

@alan-knight alan-knight 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

8 participants