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
I'm not sure what to make of this, but a value that satisfies a self type two different ways cannot be used:
voidboxIntersection<I>(Ii)
givenIsatisfiesSummable<I> {
assert (isIntegeri);
print(i + i);
// Right operand must be of compatible summable type:// type cannot be determinedprint((iofInteger) + i); // okprint((iofI) + i); // ok
}
The text was updated successfully, but these errors were encountered:
Ahahahaha, I was confused for a sec, but then I realized you just ran into our famous case of not being able to form a principal instantiation for the intersection of two instantiations of an invariant type where in one instantiation the type arg is a type parameter. A corner case that @RossTate first pointed out.
So I'm not sure if there's anything I really should do about this one. What I mean is: while I could surely write some complicated code to ad hoc detect this corner case and let it in, it's not clear to me that this would be worth the effort. I mean, the workaround is pretty trivial really.
Anyway, I don't think it's blocking the 1.2 release.
I'm not sure what to make of this, but a value that satisfies a self type two different ways cannot be used:
The text was updated successfully, but these errors were encountered: