Supported cases with two superclasses when they have different variances.

This commit is contained in:
Evgeny Gerashchenko
2012-12-04 14:13:21 +04:00
parent 482d7813ee
commit 6975691e7a
9 changed files with 234 additions and 102 deletions
@@ -0,0 +1,22 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import java.util.*;
public interface TwoSuperclassesInvariantAndCovariantInferMutability {
public interface Super1 {
@KotlinSignature("fun foo(): List<List<String>>")
public List<List<String>> foo();
}
public interface Super2 {
@KotlinSignature("fun foo(): MutableList<MutableList<String>>")
public List<List<String>> foo();
}
public interface Sub extends Super1, Super2 {
public List<List<String>> foo();
}
}
@@ -0,0 +1,16 @@
package test
public trait TwoSuperclassesInvariantAndCovariantInferMutability: Object {
public trait Super1: Object {
public fun foo(): List<List<String>>
}
public trait Super2: Object {
public fun foo(): MutableList<MutableList<String>>
}
public trait Sub: Super1, Super2 {
override fun foo(): MutableList<MutableList<String>>
}
}
@@ -0,0 +1,13 @@
namespace test
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferMutability : java.lang.Object {
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferMutability.Sub : test.TwoSuperclassesInvariantAndCovariantInferMutability.Super1, test.TwoSuperclassesInvariantAndCovariantInferMutability.Super2 {
public abstract override /*2*/ fun foo(): jet.MutableList<jet.MutableList<jet.String>>
}
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferMutability.Super1 : java.lang.Object {
public abstract fun foo(): jet.List<jet.List<jet.String>>
}
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferMutability.Super2 : java.lang.Object {
public abstract fun foo(): jet.MutableList<jet.MutableList<jet.String>>
}
}
@@ -0,0 +1,22 @@
package test;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
import java.util.*;
public interface TwoSuperclassesInvariantAndCovariantInferNullability {
public interface Super1 {
@KotlinSignature("fun foo(): List<String?>")
public List<String> foo();
}
public interface Super2 {
@KotlinSignature("fun foo(): MutableList<String>")
public List<String> foo();
}
public interface Sub extends Super1, Super2 {
public List<String> foo();
}
}
@@ -0,0 +1,16 @@
package test
public trait TwoSuperclassesInvariantAndCovariantInferNullability: Object {
public trait Super1: Object {
public fun foo(): List<String?>
}
public trait Super2: Object {
public fun foo(): MutableList<String>
}
public trait Sub: Super1, Super2 {
override fun foo(): MutableList<String>
}
}
@@ -0,0 +1,13 @@
namespace test
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferNullability : java.lang.Object {
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferNullability.Sub : test.TwoSuperclassesInvariantAndCovariantInferNullability.Super1, test.TwoSuperclassesInvariantAndCovariantInferNullability.Super2 {
public abstract override /*2*/ fun foo(): jet.MutableList<jet.String>
}
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferNullability.Super1 : java.lang.Object {
public abstract fun foo(): jet.List<jet.String?>
}
public abstract trait test.TwoSuperclassesInvariantAndCovariantInferNullability.Super2 : java.lang.Object {
public abstract fun foo(): jet.MutableList<jet.String>
}
}