Fixed direction of substitution when checking bounds of type parameters.

This commit is contained in:
Evgeny Gerashchenko
2012-12-04 18:10:07 +04:00
parent d7624aa7b6
commit 95c9c4c0c4
6 changed files with 52 additions and 2 deletions
@@ -0,0 +1,18 @@
package test;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import jet.runtime.typeinfo.KotlinSignature;
public interface UseParameterInUpperBoundWithKotlinSignature {
public interface Super {
@KotlinSignature("fun <A, B: List<A>> foo(a: A, b: B)")
<A, B extends List<A>> void foo(A a, B b);
}
public interface Sub extends Super {
@KotlinSignature("fun <B, A: List<B>> foo(b: B, a: A)")
<B, A extends List<B>> void foo(B b, A a);
}
}
@@ -0,0 +1,12 @@
package test
public trait UseParameterInUpperBoundWithKotlinSignature: Object {
public trait Super: Object {
public fun <A, B: List<A>> foo(p0: A, p1: B)
}
public trait Sub: Super {
override fun <B, A: List<B>> foo(p0: B, p1: A)
}
}
@@ -0,0 +1,10 @@
namespace test
public abstract trait test.UseParameterInUpperBoundWithKotlinSignature : java.lang.Object {
public abstract trait test.UseParameterInUpperBoundWithKotlinSignature.Sub : test.UseParameterInUpperBoundWithKotlinSignature.Super {
public abstract override /*1*/ fun </*0*/ B : jet.Any?, /*1*/ A : jet.List<B>>foo(/*0*/ p0: B, /*1*/ p1: A): jet.Tuple0
}
public abstract trait test.UseParameterInUpperBoundWithKotlinSignature.Super : java.lang.Object {
public abstract fun </*0*/ A : jet.Any?, /*1*/ B : jet.List<A>>foo(/*0*/ p0: A, /*1*/ p1: B): jet.Tuple0
}
}