The analyzer issues the following warnings on the code below:
error • Type parameters could not be inferred for the mixin 'M1' because the base class implements the mixin's supertype constraint 'I<T>' in multiple conflicting ways at /Users/leafp/tmp/ddctest.dart:10:33 • mixin_inference_inconsistent_matching_classes
error • A value of type 'int' can't be assigned to a variable of type 'String' at /Users/leafp/tmp/ddctest.dart:13:14 • invalid_assignment
Note that the second (expected) error does imply that the mixin inference is succeeding and inferring int as the type argument, but nonetheless the first (unexpected) error is emitted as if inference had failed.
class I<X> {}
class M0<T> extends I<T> {}
class M1<T> extends I<T> {
T foo() => null;
}
// M1 is inferred as M1<int>
class A extends I<int> with M0, M1 {}
void main () {
String s = new A().foo();
}
The analyzer issues the following warnings on the code below:
Note that the second (expected) error does imply that the mixin inference is succeeding and inferring
intas the type argument, but nonetheless the first (unexpected) error is emitted as if inference had failed.