-
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 onanalyzer-constantslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone
Description
This is the analyzer specific issue for the least closure part of #32415 .
The following program prints B<Null> and passes the assertion when run with DDC + kernel, but prints B<String> and fails the assertion under DDC + analyzer. The analyzer should be taking the least closure of the inferred type argument to B to eliminate the type variable (which is not otherwise a valid const type.)
class A<T> {
const A();
}
class B<T> implements A<T> {
const B();
}
class C<T> {
final _a;
const C([A<T> a = const B()]) : _a = a;
}
void main() {
var c = new C<String>();
print(c._a.runtimeType);
assert(c._a is A<Null>);
}Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onanalyzer-constantslegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)