Analyzer should hint on list assignment that is guaranteed to fail in checked mode #20610
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
The following code produces no errors, warnings, or hints in analyzer:
class A {}
class B extends A {}
main() {
List<B> listOfB = <A>[];
print(listOfB);
}
However, executing it in the VM (in checked mode) produces this error:
type 'List<A>' is not a subtype of type 'List<B>' of 'listOfB'.
It seems like analyzer should produce a hint for this.
The text was updated successfully, but these errors were encountered: