Supported variance propagation.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public class InheritVariance {
|
||||
@KotlinSignature("fun foo(): MutableCollection<out Number>")
|
||||
public Collection<Number> foo() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public class Sub extends InheritVariance {
|
||||
public List<Number> foo() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package test
|
||||
|
||||
import org.jetbrains.annotations.NotNull
|
||||
|
||||
public open class InheritVariance : java.lang.Object() {
|
||||
public open fun foo(): MutableCollection<out Number> = throw UnsupportedOperationException()
|
||||
|
||||
public open class Sub: InheritVariance() {
|
||||
override fun foo(): MutableList<out Number> = throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public open class test.InheritVariance : java.lang.Object {
|
||||
public final /*constructor*/ fun <init>(): test.InheritVariance
|
||||
public open fun foo(): jet.MutableCollection<out jet.Number>
|
||||
public open class test.InheritVariance.Sub : test.InheritVariance {
|
||||
public final /*constructor*/ fun <init>(): test.InheritVariance.Sub
|
||||
public open override /*1*/ fun foo(): jet.MutableList<out jet.Number>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user