Description
Not sure if you folks like to receive issues submitted against dev sdk builds, but here we go...
SDK 1.21.0-dev.6.0 running on Ubuntu 16.10
Strong mode on
Consider the following type hierarchy:
abstract class A {
void doA();
}
abstract class B<T> implements A {
@override void doA();
void alsoDoB();
}
class C {
void doATypeThings(A a) {
a.doA();
}
}
class D implements B<D> {
@override void doA() {}
@override void alsoDoB() {}
}
class E {
final D d;
E(this.d);
}
class F {
static final E _e = new E(new D());
void doAllTheThings(C c) {
c.doATypeThings(F._e.d); // <===== this is the line of interest
}
}
Dart analyzer interprets this correctly and marks no errors. All good.
If I then move the definition of, e.g., class D out of this file and into another file that is then imported using an import 'package:...' statement, Dart analyzer reports the following error on the line marked with the comment above:
The argument type 'D' can't be assigned to the parameter type 'A'
I cannot escape the feeling that I am doing something wrong with my file structure that is causing this, but for the life of me I cannot see what. The error is not flagged when using SDKs 1.20.1 or 1.19.0.