Open
Description
Analyzing the example program given below produces the following confusing error message:
[warning] The argument type '(Animal) → Animal' cannot be assigned to the parameter type '(Animal) → dynamic' (/Users/leafp/tmp/repo/bug_repo-master/sdk25018/test/lib2.dart, line 9, col 9)
Note that the Animal
in the first type is the version from lib2.dart
and the Animal
in the second type is the version from lib1.dart
, but nothing in the error message helps with the disambiguation.
Tested with dartanalyzer version 1.14.0-edge.26b0b1089f465de787502a8cb74e5bc9e215f9bc .
Reproduction case is a simplified version of #25018. Related to #23492 .
lib1.dart
library lib1;
class Animal {}
lib2.dart
library lib2;
import 'lib1.dart' as lib1;
class Animal {}
void main () {
List<lib1.Animal> l = <lib1.Animal>[];
l.map((Animal x) => x);
}