Add hint for incorrect assignment based on propagated types. #18864
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
This code:
class A {}
class B {}
main() {
Map<String, A> c = <String, A>{};
c['foo'] = new B();
}
produces the warning "A value of type 'B' cannot be assigned to a variable of type 'A'", as expected.
This code should produce the equivalent hint, but it doesn't:
class A {}
class B {}
main() {
var c = <String, A>{};
c['foo'] = new B();
}
The text was updated successfully, but these errors were encountered: