Supported variance propagation.

This commit is contained in:
Evgeny Gerashchenko
2012-11-13 14:31:30 +04:00
parent 9177080d8b
commit 3b63e6e061
6 changed files with 97 additions and 8 deletions
@@ -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>
}
}