You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we do correctly reject the code (new MI() not being legal in strong mode), but it seems like we're going off the rails a bit here. I would expect the error at the new expressions. Instead we seem to infer non-sensical type arguments for new MI and new PMI.
import"package:expect/expect.dart";
// Regression test for recursive inheritance patternsabstractclassComparable<T> {
intcompare(T a);
}
classMI<TextendsMI<T>> {}
classPMI<TextendsComparable<T>> extendsMI<PMI<T>> {}
voidmain() {
var a =newMI();
var b =newPMI();
// [error] A value of type 'PMI<Comparable<Comparable<T>>>' cannot be assigned to a variable of type 'MI<MI<MI<T>>>'
a = b;
Expect.isTrue(a isMI);
Expect.isTrue(b isPMI);
Expect.isTrue(b isMI);
Expect.isTrue(b isMI<PMI>);
}
The text was updated successfully, but these errors were encountered:
This may have been improved by a recent commit: 0fe54a6, or we may have another similar issue. There were a couple of things wrong with inference and recursive bounds.
yeah @zoechi, I wondered the same thing! Will have to try it. In general these patterns are kind of unsound, so it may still be valid to reject the code. But I hope it rejects the code with a valid error, not because it was going off the rails and computing crazy types. :)
we do correctly reject the code (
new MI()
not being legal in strong mode), but it seems like we're going off the rails a bit here. I would expect the error at the new expressions. Instead we seem to infer non-sensical type arguments fornew MI
andnew PMI
.The text was updated successfully, but these errors were encountered: