Lower bound must be a subtype of the upper bound.
The change in CommonSupertypes: We used to say that commonSupertype(Inv<A>, Inv<B>) = Inv<in Intersect(A, B)). This is counter-intuitive, should be Inv<out commonSupertype(A, B)>
This commit is contained in:
@@ -200,6 +200,8 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
assertCommonSupertype("Base_T<in Int>", "Derived_T<Int>", "Base_T<in Int>");
|
||||
assertCommonSupertype("Base_T<in Int>", "Derived_T<in Int>", "Base_T<Int>");
|
||||
assertCommonSupertype("Base_T<*>", "Base_T<Int>", "Base_T<*>");
|
||||
|
||||
assertCommonSupertype("Base_T<out Parent>", "Base_T<A>", "Base_T<B>");
|
||||
}
|
||||
|
||||
public void testIntersect() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user