Checking redundant/conflicting projection kind in alt signatures.

This commit is contained in:
Evgeny Gerashchenko
2013-02-01 13:55:01 +04:00
parent a47ff5cdb5
commit 4be1e7d8d8
15 changed files with 111 additions and 20 deletions
@@ -5,8 +5,8 @@ import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
public class MethodWithMappedClasses {
@KotlinSignature("fun <T> copy(dest : MutableList<in T>, src : List<out T>)")
public <T> void copy(List<? super T> dest, List<? extends T> src) {
@KotlinSignature("fun <T> copy(dest : MutableList<in T>, src : List<T>)")
public <T> void copy(List<? super T> dest, List<T> src) {
throw new UnsupportedOperationException();
}
}
@@ -3,5 +3,5 @@ package test
import java.util.*
public open class MethodWithMappedClasses : Object() {
public open fun <T> copy(p0 : MutableList<in T>, p1 : List<out T>) {}
public open fun <T> copy(p0 : MutableList<in T>, p1 : List<T>) {}
}
@@ -2,5 +2,5 @@ package test
public open class MethodWithMappedClasses : java.lang.Object {
public constructor MethodWithMappedClasses()
public open fun </*0*/ T> copy(/*0*/ p0 : jet.MutableList<in T>, /*1*/ p1 : jet.List<out T>) : Unit
public open fun </*0*/ T> copy(/*0*/ p0 : jet.MutableList<in T>, /*1*/ p1 : jet.List<T>) : Unit
}
@@ -8,7 +8,7 @@ import java.util.List;
import jet.runtime.typeinfo.KotlinSignature;
public class MethodWithTypeParameters {
@KotlinSignature("fun <A, B : Runnable> foo(a : A, b : List<out B>, c: MutableList<in String?>) where B : List<Cloneable>")
@KotlinSignature("fun <A, B : Runnable> foo(a : A, b : List<B>, c: MutableList<in String?>) where B : List<Cloneable>")
public <A, B extends Runnable & List<Cloneable>> void foo(A a, List<? extends B> b, List<? super String> list) {
}
}
@@ -3,6 +3,6 @@ package test
import java.util.*
public open class MethodWithTypeParameters : Object() {
public open fun <erased A, erased B : Runnable> foo(p0 : A, p1 : List<out B>, p2: MutableList<in String?>) where B : List<Cloneable> {
public open fun <erased A, erased B : Runnable> foo(p0 : A, p1 : List<B>, p2: MutableList<in String?>) where B : List<Cloneable> {
}
}
@@ -2,5 +2,5 @@ package test
public open class MethodWithTypeParameters : java.lang.Object {
public constructor MethodWithTypeParameters()
public open fun </*0*/ A, /*1*/ B> foo(/*0*/ p0 : A, /*1*/ p1 : jet.List<out B>, /*2*/ p2 : jet.MutableList<in jet.String?>) : Unit where B : java.lang.Runnable, B : jet.List<java.lang.Cloneable>
public open fun </*0*/ A, /*1*/ B> foo(/*0*/ p0 : A, /*1*/ p1 : jet.List<B>, /*2*/ p2 : jet.MutableList<in jet.String?>) : Unit where B : java.lang.Runnable, B : jet.List<java.lang.Cloneable>
}
@@ -0,0 +1,15 @@
package test;
import java.lang.Number;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
public class ConflictingProjectionKind {
@ExpectLoadError("Projection kind 'in' is conflicting with variance of jet.List")
@KotlinSignature("fun foo(list: List<in Number>)")
public void foo(List<Number> list) {
throw new UnsupportedOperationException();
}
}
@@ -0,0 +1,7 @@
package test
public open class ConflictingProjectionKind : Object() {
public open fun foo(p0: List<Number>?) {
throw UnsupportedOperationException()
}
}
@@ -0,0 +1,6 @@
package test
public open class ConflictingProjectionKind : java.lang.Object {
public constructor ConflictingProjectionKind()
public open fun foo(/*0*/ p0 : jet.List<jet.Number>?) : Unit
}
@@ -0,0 +1,14 @@
package test;
import java.lang.Number;
import java.util.*;
import jet.runtime.typeinfo.KotlinSignature;
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
public class RedundantProjectionKind {
@KotlinSignature("fun foo(list: List<out Number>)")
public void foo(List<Number> list) {
throw new UnsupportedOperationException();
}
}
@@ -0,0 +1,7 @@
package test
public open class RedundantProjectionKind : Object() {
public open fun foo(p0: List<Number>) {
throw UnsupportedOperationException()
}
}
@@ -0,0 +1,6 @@
package test
public open class RedundantProjectionKind : java.lang.Object {
public constructor RedundantProjectionKind()
public open fun foo(/*0*/ p0 : jet.List<jet.Number>) : Unit
}