Added tests for signatures propagation.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
package test;
|
||||
|
||||
import java.util.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface HalfSubstitutedTypeParameters {
|
||||
|
||||
public interface TrickyList<X, E> extends List<E> {}
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun foo(): MutableList<String>")
|
||||
List<String> foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
TrickyList<Integer, String> foo();
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait HalfSubstitutedTypeParameters: Object {
|
||||
|
||||
public trait TrickyList<X, E>: MutableList<E> {}
|
||||
|
||||
public trait Super: Object {
|
||||
public fun foo(): MutableList<String>
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun foo(): TrickyList<Int?, String>
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.HalfSubstitutedTypeParameters : java.lang.Object {
|
||||
public abstract trait test.HalfSubstitutedTypeParameters.Sub : test.HalfSubstitutedTypeParameters.Super {
|
||||
public abstract override /*1*/ fun foo(): test.HalfSubstitutedTypeParameters.TrickyList<jet.Int?, jet.String>
|
||||
}
|
||||
public abstract trait test.HalfSubstitutedTypeParameters.Super : java.lang.Object {
|
||||
public abstract fun foo(): jet.MutableList<jet.String>
|
||||
}
|
||||
public abstract trait test.HalfSubstitutedTypeParameters.TrickyList</*0*/ X : jet.Any?, /*1*/ E : jet.Any?> : jet.MutableList<E> {
|
||||
public abstract override /*1*/ /*fake_override*/ fun add(/*0*/ e: E): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun add(/*0*/ index: jet.Int, /*1*/ element: E): jet.Tuple0
|
||||
public abstract override /*1*/ /*fake_override*/ fun addAll(/*0*/ c: jet.Collection<out E>): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun addAll(/*0*/ index: jet.Int, /*1*/ c: jet.Collection<out E>): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun clear(): jet.Tuple0
|
||||
public abstract override /*1*/ /*fake_override*/ fun contains(/*0*/ o: jet.Any?): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun containsAll(/*0*/ c: jet.Collection<out jet.Any?>): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ index: jet.Int): E
|
||||
public abstract override /*1*/ /*fake_override*/ fun indexOf(/*0*/ o: jet.Any?): jet.Int
|
||||
public abstract override /*1*/ /*fake_override*/ fun isEmpty(): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun iterator(): jet.Iterator<E>
|
||||
public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ o: jet.Any?): jet.Int
|
||||
public abstract override /*1*/ /*fake_override*/ fun listIterator(): jet.MutableListIterator<E>
|
||||
public abstract override /*1*/ /*fake_override*/ fun listIterator(/*0*/ index: jet.Int): jet.MutableListIterator<E>
|
||||
public abstract override /*1*/ /*fake_override*/ fun remove(/*0*/ index: jet.Int): E
|
||||
public abstract override /*1*/ /*fake_override*/ fun remove(/*0*/ o: jet.Any?): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun removeAll(/*0*/ c: jet.Collection<out jet.Any?>): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun retainAll(/*0*/ c: jet.Collection<out jet.Any?>): jet.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun set(/*0*/ index: jet.Int, /*1*/ element: E): E
|
||||
public abstract override /*1*/ /*fake_override*/ fun size(): jet.Int
|
||||
public abstract override /*1*/ /*fake_override*/ fun subList(/*0*/ fromIndex: jet.Int, /*1*/ toIndex: jet.Int): jet.MutableList<E>
|
||||
public abstract override /*1*/ /*fake_override*/ fun toArray(): jet.Array<jet.Any?>
|
||||
public abstract override /*1*/ /*fake_override*/ fun </*0*/ T : jet.Any?>toArray(/*0*/ a: jet.Array<out T>): jet.Array<T>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface SameProjectionKind {
|
||||
|
||||
public interface Super {
|
||||
Collection<? extends Number> foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
Collection<? extends Number> foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait SameProjectionKind: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun foo(): MutableCollection<out Number?>?
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun foo(): MutableCollection<out Number?>?
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.SameProjectionKind : java.lang.Object {
|
||||
public abstract trait test.SameProjectionKind.Sub : test.SameProjectionKind.Super {
|
||||
public abstract override /*1*/ fun foo(): jet.MutableCollection<out jet.Number?>?
|
||||
}
|
||||
public abstract trait test.SameProjectionKind.Super : java.lang.Object {
|
||||
public abstract fun foo(): jet.MutableCollection<out jet.Number?>?
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public interface TwoSuperclassesConflictingProjectionKinds {
|
||||
|
||||
public interface Super1 {
|
||||
@KotlinSignature("fun foo(): MutableCollection<CharSequence>")
|
||||
public Collection<CharSequence> foo();
|
||||
}
|
||||
|
||||
public interface Super2 {
|
||||
@KotlinSignature("fun foo(): MutableCollection<out CharSequence>")
|
||||
public Collection<CharSequence> foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super1, Super2 {
|
||||
public Collection<CharSequence> foo();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesConflictingProjectionKinds: Object {
|
||||
|
||||
public trait Super1: Object {
|
||||
public fun foo(): MutableCollection<CharSequence>
|
||||
}
|
||||
|
||||
public trait Super2: Object {
|
||||
public fun foo(): MutableCollection<out CharSequence>
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
override fun foo(): MutableCollection<CharSequence>
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoSuperclassesConflictingProjectionKinds : java.lang.Object {
|
||||
public abstract trait test.TwoSuperclassesConflictingProjectionKinds.Sub : test.TwoSuperclassesConflictingProjectionKinds.Super1, test.TwoSuperclassesConflictingProjectionKinds.Super2 {
|
||||
public abstract override /*2*/ fun foo(): jet.MutableCollection<jet.CharSequence>
|
||||
}
|
||||
public abstract trait test.TwoSuperclassesConflictingProjectionKinds.Super1 : java.lang.Object {
|
||||
public abstract fun foo(): jet.MutableCollection<jet.CharSequence>
|
||||
}
|
||||
public abstract trait test.TwoSuperclassesConflictingProjectionKinds.Super2 : java.lang.Object {
|
||||
public abstract fun foo(): jet.MutableCollection<out jet.CharSequence>
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import java.util.*;
|
||||
|
||||
public interface TwoSuperclassesMutableAndNot {
|
||||
|
||||
public interface Super1 {
|
||||
@KotlinSignature("fun foo(): MutableCollection<String>")
|
||||
public Collection<String> foo();
|
||||
}
|
||||
|
||||
public interface Super2 {
|
||||
@KotlinSignature("fun foo(): List<String>")
|
||||
public List<String> foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super1, Super2 {
|
||||
public List<String> foo();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesMutableAndNot: Object {
|
||||
|
||||
public trait Super1: Object {
|
||||
public fun foo(): MutableCollection<String>
|
||||
}
|
||||
|
||||
public trait Super2: Object {
|
||||
public fun foo(): List<String>
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoSuperclassesMutableAndNot : java.lang.Object {
|
||||
public abstract trait test.TwoSuperclassesMutableAndNot.Sub : test.TwoSuperclassesMutableAndNot.Super1, test.TwoSuperclassesMutableAndNot.Super2 {
|
||||
public abstract override /*2*/ fun foo(): jet.MutableList<jet.String>
|
||||
}
|
||||
public abstract trait test.TwoSuperclassesMutableAndNot.Super1 : java.lang.Object {
|
||||
public abstract fun foo(): jet.MutableCollection<jet.String>
|
||||
}
|
||||
public abstract trait test.TwoSuperclassesMutableAndNot.Super2 : java.lang.Object {
|
||||
public abstract fun foo(): jet.List<jet.String>
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import java.util.*;
|
||||
import jet.*;
|
||||
|
||||
public interface TwoSuperclassesSupplementNotNull {
|
||||
|
||||
public interface Super1 {
|
||||
@KotlinSignature("fun foo(): Function0<String?>")
|
||||
public Function0<String> foo();
|
||||
}
|
||||
|
||||
public interface Super2 {
|
||||
@KotlinSignature("fun foo(): Function0<String>?")
|
||||
public Function0<String> foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super1, Super2 {
|
||||
public Function0<String> foo();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesSupplementNotNull: Object {
|
||||
|
||||
public trait Super1: Object {
|
||||
public fun foo(): Function0<String?>
|
||||
}
|
||||
|
||||
public trait Super2: Object {
|
||||
public fun foo(): Function0<String>?
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
override fun foo(): Function0<String>
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoSuperclassesSupplementNotNull : java.lang.Object {
|
||||
public abstract trait test.TwoSuperclassesSupplementNotNull.Sub : test.TwoSuperclassesSupplementNotNull.Super1, test.TwoSuperclassesSupplementNotNull.Super2 {
|
||||
public abstract override /*2*/ fun foo(): jet.Function0<jet.String>
|
||||
}
|
||||
public abstract trait test.TwoSuperclassesSupplementNotNull.Super1 : java.lang.Object {
|
||||
public abstract fun foo(): jet.Function0<jet.String?>
|
||||
}
|
||||
public abstract trait test.TwoSuperclassesSupplementNotNull.Super2 : java.lang.Object {
|
||||
public abstract fun foo(): jet.Function0<jet.String>?
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import java.util.*;
|
||||
|
||||
public interface TypeParamOfClass {
|
||||
|
||||
public interface Super<T> {
|
||||
@NotNull
|
||||
public T foo();
|
||||
}
|
||||
|
||||
public interface Sub<T> extends Super<T> {
|
||||
public T foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TypeParamOfClass: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(): T
|
||||
}
|
||||
|
||||
public trait Sub<T>: Super<T> {
|
||||
override fun foo(): T
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TypeParamOfClass : java.lang.Object {
|
||||
public abstract trait test.TypeParamOfClass.Sub</*0*/ T : jet.Any?> : test.TypeParamOfClass.Super<T> {
|
||||
public abstract override /*1*/ fun foo(): T
|
||||
}
|
||||
public abstract trait test.TypeParamOfClass.Super</*0*/ T : jet.Any?> : java.lang.Object {
|
||||
public abstract fun foo(): T
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import java.util.*;
|
||||
|
||||
public interface TypeParamOfClassSubstituted {
|
||||
|
||||
public interface Super<T> {
|
||||
@NotNull
|
||||
public T foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super<String> {
|
||||
public String foo();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TypeParamOfClassSubstituted: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(): T
|
||||
}
|
||||
|
||||
public trait Sub: Super<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TypeParamOfClassSubstituted : java.lang.Object {
|
||||
public abstract trait test.TypeParamOfClassSubstituted.Sub : test.TypeParamOfClassSubstituted.Super<jet.String> {
|
||||
public abstract override /*1*/ fun foo(): jet.String
|
||||
}
|
||||
public abstract trait test.TypeParamOfClassSubstituted.Super</*0*/ T : jet.Any?> : java.lang.Object {
|
||||
public abstract fun foo(): T
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import java.util.*;
|
||||
|
||||
public interface TypeParamOfFun {
|
||||
|
||||
public interface Super {
|
||||
@NotNull
|
||||
public <T> T foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
public <E> E foo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TypeParamOfFun: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <T> foo(): T
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <E> foo(): E
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TypeParamOfFun : java.lang.Object {
|
||||
public abstract trait test.TypeParamOfFun.Sub : test.TypeParamOfFun.Super {
|
||||
public abstract override /*1*/ fun </*0*/ E : jet.Any?>foo(): E
|
||||
}
|
||||
public abstract trait test.TypeParamOfFun.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ T : jet.Any?>foo(): T
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user