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

The editor should warn if a lexical identifier is taking precedence over an inherited one #12078

Open
DartBot opened this issue Jul 26, 2013 · 7 comments
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. 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

@DartBot
Copy link

DartBot commented Jul 26, 2013

This issue was originally filed by Erik.Gr...@gmail.com


http://www.dartlang.org/docs/spec/latest/dart-language-specification.html

Issue/feedback:

    The interaction of lexical scoping and inheritance can be pretty surprising and well, nasty. It's also burdensome to have to review the top level functions of every library you import to see if it happens to contain a definition that will overwrite one you have somewhere in your inheritance hierarchy. The section in the language spec on scoping and inheritance suggests warning users when this occurs.

@bwilkerson
Copy link
Member

I'm not sure why this was under "Documentation". If there was a good reason, feel free to change it back.


Added this to the Later milestone.
Removed Area-Documentation label.
Added Area-Analyzer, Priority-Medium labels.

@DartBot
Copy link
Author

DartBot commented Jul 27, 2013

This comment was originally written by Erik.G...@gmail.com


The spec only suggests giving the user a warning, so it seemed more an enhancement (i.e. documentation/feedback in dartbug) than a defect (defect report from user). Should enhancements be submitted as 'defect report from user' instead?

@bwilkerson
Copy link
Member

Removed Type-Defect label.
Added Type-Enhancement label.

@bwilkerson
Copy link
Member

Added Analyzer-Hint 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.

@DartBot DartBot added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. Type-Enhancement analyzer-warning Issues with the analyzer's Warning codes labels Aug 4, 2014
@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 Feb 29, 2016
@lrhn
Copy link
Member

lrhn commented Sep 14, 2020

Dart is now (more) strongly typed, so hitting the "wrong" identifier is very likely to be immediately visible.

The analyzer could still recognize when a lexical name gives the wrong type, and an instance member with the same name could (perhaps) have been correct, and suggest using this.foo instead of foo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-warning Issues with the analyzer's Warning codes area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. 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