-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onfront-end-missing-errorlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone
Description
Consider the following code:
import 'dart:core';
import 'dart:core' as core;
class A {
core.List get core => null; // (1)
}
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 type core.List
should be invalid.
But the front end accepts this code without complaint, and considers the return type of the getter to be the type List
from dart:core
.
Note that the analyzer's handling of this case isn't correct either; it also accepts the code without complaint, but it consideres the return type of the getter to be dynamic
.
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onfront-end-missing-errorlegacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)