Analyzer fails to report error for import prefix hidden by class member (when used to name a type) #34500
Labels
analyzer-spec
Issues with the analyzer's implementation of the language spec
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
Consider the following code:
Based on my reading of the spec, there should be a compile-time error at (1), because the declaration of the getter
core
inside of class A hides the import prefix declared at top level. So the typecore.List
should be invalid.Oddly, the analyzer accepts this code without complaint, but it considers the return type of the getter to be the type
dynamic
.Note that the front end's handling of this case isn't correct either--see #34498.
The text was updated successfully, but these errors were encountered: