Open sigurdm opened 9 years ago
dartanalyzer includes a duplicate import error. But the VM still confusingly says "Method not found: 'foo'."
$ dart --version
Dart VM version: 2.0.0-dev.63.0 (Fri Jun 15 00:42:43 2018 +0200) on "macos_x64"
$ cat 23840.dart
import "23840-lib.dart";
import "23840-lib2.dart";
void main() {
foo();
}
$ cat 23840-lib.dart
foo() {}
$ cat 23840-lib2.dart
foo() {}
$ dartanalyzer 23840.dart
Analyzing 23840.dart...
error • The name 'foo' is defined in the libraries '23840-lib.dart' and '23840-lib2.dart' at 23840.dart:5:3 • ambiguous_import
1 error found.
$ dart --preview-dart-2 23840.dart
23840.dart:5:3: Error: Method not found: 'foo'.
foo();
^^^
😖
main.dart:
lib1.dart:
lib2.dart
The vm prints
It would be more helpful with a message mentioning the duplicate import.