Supported propagation of upper bounds of method type parameters.
#KT-2776 in progress
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
public interface InheritMutability {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: MutableList<String>> foo(a: A)")
|
||||
<A extends List<String>> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends List<String>> void foo(B b);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritMutability: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: MutableList<String>> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: MutableList<String>> foo(p0: B)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.InheritMutability : java.lang.Object {
|
||||
public abstract trait test.InheritMutability.Sub : test.InheritMutability.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.MutableList<jet.String>>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.InheritMutability.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.MutableList<jet.String>>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface InheritNullability {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: CharSequence> foo(a: A)")
|
||||
<A extends CharSequence> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends CharSequence> void foo(B b);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullability: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: CharSequence> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: CharSequence> foo(p0: B)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.InheritNullability : java.lang.Object {
|
||||
public abstract trait test.InheritNullability.Sub : test.InheritNullability.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.CharSequence>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.InheritNullability.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.CharSequence>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
import java.util.*;
|
||||
|
||||
public interface InheritReadOnliness {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: List<String>> foo(a: A)")
|
||||
<A extends List<String>> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends List<String>> void foo(B b);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritReadOnliness: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: List<String>> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: List<String>> foo(p0: B)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.InheritReadOnliness : java.lang.Object {
|
||||
public abstract trait test.InheritReadOnliness.Sub : test.InheritReadOnliness.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.List<jet.String>>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.InheritReadOnliness.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.List<jet.String>>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.Cloneable;
|
||||
|
||||
public interface TwoBounds {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: CharSequence> foo(a: A) where A: Cloneable")
|
||||
<A extends CharSequence & Cloneable> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends CharSequence & Cloneable> void foo(B b);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TwoBounds: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: CharSequence> foo(p0: A) where A: Cloneable
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: CharSequence> foo(p0: B) where B: Cloneable
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoBounds : java.lang.Object {
|
||||
public abstract trait test.TwoBounds.Sub : test.TwoBounds.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : java.lang.Cloneable & jet.CharSequence>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoBounds.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : java.lang.Cloneable & jet.CharSequence>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface TwoSuperclasses {
|
||||
|
||||
public interface Super1 {
|
||||
@KotlinSignature("fun <A: CharSequence> foo(a: A)")
|
||||
<A extends CharSequence> void foo(A a);
|
||||
}
|
||||
|
||||
public interface Super2 {
|
||||
@KotlinSignature("fun <B: CharSequence> foo(a: B)")
|
||||
<B extends CharSequence> void foo(B a);
|
||||
}
|
||||
|
||||
public interface Sub extends Super1, Super2 {
|
||||
<C extends CharSequence> void foo(C c);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclasses: Object {
|
||||
|
||||
public trait Super1: Object {
|
||||
public fun <A: CharSequence> foo(p0: A)
|
||||
}
|
||||
|
||||
public trait Super2: Object {
|
||||
public fun <B: CharSequence> foo(p0: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
override fun <C: CharSequence> foo(p0: C)
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoSuperclasses : java.lang.Object {
|
||||
public abstract trait test.TwoSuperclasses.Sub : test.TwoSuperclasses.Super1, test.TwoSuperclasses.Super2 {
|
||||
public abstract override /*2*/ fun </*0*/ C : jet.CharSequence>foo(/*0*/ p0: C): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoSuperclasses.Super1 : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.CharSequence>foo(/*0*/ p0: A): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoSuperclasses.Super2 : java.lang.Object {
|
||||
public abstract fun </*0*/ B : jet.CharSequence>foo(/*0*/ p0: B): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface TwoTypeParameters {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A: CharSequence, B: Cloneable> foo(a: A, b: B)")
|
||||
<A extends CharSequence, B extends Cloneable> void foo(A a, B b);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B extends CharSequence, A extends Cloneable> void foo(B b, A a);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TwoTypeParameters: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A: CharSequence, B: Cloneable> foo(p0: A, p1: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B: CharSequence, A: Cloneable> foo(p0: B, p1: A)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.TwoTypeParameters : java.lang.Object {
|
||||
public abstract trait test.TwoTypeParameters.Sub : test.TwoTypeParameters.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.CharSequence, /*1*/ A : java.lang.Cloneable>foo(/*0*/ p0: B, /*1*/ p1: A): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.TwoTypeParameters.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.CharSequence, /*1*/ B : java.lang.Cloneable>foo(/*0*/ p0: A, /*1*/ p1: B): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import java.util.List;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface UseParameterAsUpperBound {
|
||||
|
||||
public interface Super {
|
||||
@KotlinSignature("fun <A, B: A> foo(a: A, b: B)")
|
||||
<A, B extends A> void foo(A a, B b);
|
||||
}
|
||||
|
||||
public interface Sub extends Super {
|
||||
<B, A extends B> void foo(B b, A a);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait UseParameterAsUpperBound: Object {
|
||||
|
||||
public trait Super: Object {
|
||||
public fun <A, B: A> foo(p0: A, p1: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
override fun <B, A: B> foo(p0: B, p1: A)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.UseParameterAsUpperBound : java.lang.Object {
|
||||
public abstract trait test.UseParameterAsUpperBound.Sub : test.UseParameterAsUpperBound.Super {
|
||||
public abstract override /*1*/ fun </*0*/ B : jet.Any?, /*1*/ A : B>foo(/*0*/ p0: B, /*1*/ p1: A): jet.Tuple0
|
||||
}
|
||||
public abstract trait test.UseParameterAsUpperBound.Super : java.lang.Object {
|
||||
public abstract fun </*0*/ A : jet.Any?, /*1*/ B : A>foo(/*0*/ p0: A, /*1*/ p1: B): jet.Tuple0
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import java.util.List;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface UseParameterInUpperBound {
|
||||
|
||||
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 {
|
||||
<B, A extends List<B>> void foo(B b, A a);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait UseParameterInUpperBound: 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)
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
namespace test
|
||||
|
||||
public abstract trait test.UseParameterInUpperBound : java.lang.Object {
|
||||
public abstract trait test.UseParameterInUpperBound.Sub : test.UseParameterInUpperBound.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.UseParameterInUpperBound.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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user