No warning when abstract class from imported library is also declared in file #5871
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
Consider this code:
import 'dart:html';
var screens = new Map<String, Screen>();
addScreen(String name) {
screens[name] = new Screen();
}
Screen returnScreen(String name) {
return screens[name];
}
class Screen {
}
main() {
addScreen("foo");
var s = returnScreen("foo");
print(s.runtimeType);
}
When you run it, you get this error:
Exception: type 'Screen' is not a subtype of type 'Screen' of 'function result'.
Stack Trace: #0 returnScreen (http://127.0.0.1:3030/Users/sethladd/dart/dupehtmlclassname/dupehtmlclassname.dart:13:17)
1 main (http://127.0.0.1:3030/Users/sethladd/dart/dupehtmlclassname/dupehtmlclassname.dart:22:23)
There is an abstract class named Screen in dart:html.
I would expect some sort of warning from the Editor when I declared a class named Screen.
The text was updated successfully, but these errors were encountered: