Closed
Description
Dart VM version: 2.0.0-dev.69.0 (Tue Jul 17 14:57:16 2018 +0200) on "macos_x64"
macOS mojave
When to different files include the same file, once with import "package:mylib/test.dart";
and once with import "test.dart";
the dart runtime doesn't recognise the classes to be identical anymore.
// lib/test.dart
class Foo {
}
// lib/a.dart
import 'test.dart';
Foo getFoo() => new Foo();
// lib/b.dart
import 'package:mylib/test.dart';
import 'a.dart';
main() {
Foo foo = getFoo(); // This fails
}
Error:
Error: A value of type '#lib1::Foo' can't be assigned to a variable of type '#lib2::Foo'.
Try changing the type of the left hand side, or casting the right hand side to '#lib2::Foo'.
Metadata
Metadata
Assignees
Labels
No labels