KT-3302 Method that implements two differing interfaces are reported as "Incompatible types in superclasses"
#KT-3302 fixed
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface DeeplySubstitutedClassParameter {
|
||||
|
||||
public interface Super<T> {
|
||||
@KotlinSignature("fun foo(t: T)")
|
||||
void foo(T p);
|
||||
}
|
||||
|
||||
public interface Middle<E> extends Super<E> {
|
||||
void foo(E p);
|
||||
}
|
||||
|
||||
public interface Sub extends Middle<String> {
|
||||
void foo(String p);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(p0: T)
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
override fun foo(p0: E)
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
override fun foo(p0: String)
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter : java.lang.Object {
|
||||
|
||||
public trait Middle</*0*/ E> : test.DeeplySubstitutedClassParameter.Super<E> {
|
||||
public abstract override /*1*/ fun foo(/*0*/ p0 : E) : Unit
|
||||
}
|
||||
|
||||
public trait Sub : test.DeeplySubstitutedClassParameter.Middle<jet.String> {
|
||||
public abstract override /*1*/ fun foo(/*0*/ p0 : jet.String) : Unit
|
||||
}
|
||||
|
||||
public trait Super</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo(/*0*/ p0 : T) : Unit
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface DeeplySubstitutedClassParameter2 {
|
||||
|
||||
public interface Super<T> {
|
||||
@KotlinSignature("fun foo(t: T)")
|
||||
void foo(T p);
|
||||
}
|
||||
|
||||
public interface Middle<E> extends Super<E> {
|
||||
}
|
||||
|
||||
public interface Sub extends Middle<String> {
|
||||
void foo(String p);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter2: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(p0: T)
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
override fun foo(p0: String)
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter2 : java.lang.Object {
|
||||
|
||||
public trait Middle</*0*/ E> : test.DeeplySubstitutedClassParameter2.Super<E> {
|
||||
public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ p0 : E) : Unit
|
||||
}
|
||||
|
||||
public trait Sub : test.DeeplySubstitutedClassParameter2.Middle<jet.String> {
|
||||
public abstract override /*1*/ fun foo(/*0*/ p0 : jet.String) : Unit
|
||||
}
|
||||
|
||||
public trait Super</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo(/*0*/ p0 : T) : Unit
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
// See SubclassFromGenericAndNot, as well
|
||||
public interface Kt3302 {
|
||||
public interface BSONObject {
|
||||
Object put(@NotNull String s, @NotNull Object o);
|
||||
}
|
||||
|
||||
public interface LinkedHashMap<K, V> {
|
||||
@KotlinSignature("fun put(key : K, value : V) : V?")
|
||||
public V put(K key, V value);
|
||||
}
|
||||
|
||||
public interface BasicBSONObject extends LinkedHashMap<String, Object>, BSONObject {
|
||||
@Override
|
||||
public Object put(String key, Object value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
// See SubclassFromGenericAndNot, as well
|
||||
public trait Kt3302: Object {
|
||||
public trait BSONObject : Object {
|
||||
public fun put(p0: String, p1: Any): Any?
|
||||
}
|
||||
|
||||
public trait LinkedHashMap<K, V> : Object {
|
||||
public fun put(p0: K, p1: V): V?
|
||||
}
|
||||
|
||||
public trait BasicBSONObject : LinkedHashMap<String, Any>, BSONObject {
|
||||
override fun put(p0: String, p1: Any): Any?
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait Kt3302 : java.lang.Object {
|
||||
|
||||
public trait BSONObject : java.lang.Object {
|
||||
public abstract fun put(/*0*/ p0 : jet.String, /*1*/ p1 : jet.Any) : jet.Any?
|
||||
}
|
||||
|
||||
public trait BasicBSONObject : test.Kt3302.LinkedHashMap<jet.String, jet.Any>, test.Kt3302.BSONObject {
|
||||
public abstract override /*2*/ fun put(/*0*/ p0 : jet.String, /*1*/ p1 : jet.Any) : jet.Any?
|
||||
}
|
||||
|
||||
public trait LinkedHashMap</*0*/ K, /*1*/ V> : java.lang.Object {
|
||||
public abstract fun put(/*0*/ p0 : K, /*1*/ p1 : V) : V?
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
// Extracted from KT-3302, see Kt3302 test, as well
|
||||
public interface SubclassFromGenericAndNot {
|
||||
|
||||
public interface NonGeneric {
|
||||
void foo(@NotNull String s);
|
||||
}
|
||||
|
||||
public interface Generic<T> {
|
||||
@KotlinSignature("fun foo(key : T)")
|
||||
public void foo(T key);
|
||||
}
|
||||
|
||||
public interface Sub extends NonGeneric, Generic<String> {
|
||||
@Override
|
||||
public void foo(String key);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test
|
||||
|
||||
// Extracted from KT-3302, see Kt3302 test, as well
|
||||
public trait SubclassFromGenericAndNot: Object {
|
||||
|
||||
public trait NonGeneric : Object {
|
||||
public fun foo(p0: String)
|
||||
}
|
||||
|
||||
public trait Generic<T> : Object {
|
||||
public fun foo(p0: T)
|
||||
}
|
||||
|
||||
public trait Sub : NonGeneric, Generic<String> {
|
||||
override fun foo(p0: String)
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait SubclassFromGenericAndNot : java.lang.Object {
|
||||
|
||||
public trait Generic</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo(/*0*/ p0 : T) : Unit
|
||||
}
|
||||
|
||||
public trait NonGeneric : java.lang.Object {
|
||||
public abstract fun foo(/*0*/ p0 : jet.String) : Unit
|
||||
}
|
||||
|
||||
public trait Sub : test.SubclassFromGenericAndNot.NonGeneric, test.SubclassFromGenericAndNot.Generic<jet.String> {
|
||||
public abstract override /*2*/ fun foo(/*0*/ p0 : jet.String) : Unit
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface SubstitutedClassParameter {
|
||||
|
||||
public interface Super<T> {
|
||||
@KotlinSignature("fun foo(t: T)")
|
||||
void foo(T p);
|
||||
}
|
||||
|
||||
public interface Sub extends Super<String> {
|
||||
void foo(String p);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameter: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(p0: T)
|
||||
}
|
||||
|
||||
public trait Sub: Super<String> {
|
||||
override fun foo(p0: String)
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameter : java.lang.Object {
|
||||
|
||||
public trait Sub : test.SubstitutedClassParameter.Super<jet.String> {
|
||||
public abstract override /*1*/ fun foo(/*0*/ p0 : jet.String) : Unit
|
||||
}
|
||||
|
||||
public trait Super</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo(/*0*/ p0 : T) : Unit
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface SubstitutedClassParameters {
|
||||
|
||||
public interface Super1<T> {
|
||||
@KotlinSignature("fun foo(t: T)")
|
||||
void foo(T p);
|
||||
}
|
||||
|
||||
public interface Super2<E> {
|
||||
@KotlinSignature("fun foo(t: E)")
|
||||
void foo(E p);
|
||||
}
|
||||
|
||||
public interface Sub extends Super1<String>, Super2<String> {
|
||||
void foo(String p);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameters: Object {
|
||||
|
||||
public trait Super1<T>: Object {
|
||||
public fun foo(p0: T)
|
||||
}
|
||||
|
||||
public trait Super2<E>: Object {
|
||||
public fun foo(p0: E)
|
||||
}
|
||||
|
||||
public trait Sub: Super1<String>, Super2<String> {
|
||||
override fun foo(p0: String)
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameters : java.lang.Object {
|
||||
|
||||
public trait Sub : test.SubstitutedClassParameters.Super1<jet.String>, test.SubstitutedClassParameters.Super2<jet.String> {
|
||||
public abstract override /*2*/ fun foo(/*0*/ p0 : jet.String) : Unit
|
||||
}
|
||||
|
||||
public trait Super1</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo(/*0*/ p0 : T) : Unit
|
||||
}
|
||||
|
||||
public trait Super2</*0*/ E> : java.lang.Object {
|
||||
public abstract fun foo(/*0*/ p0 : E) : Unit
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public interface DeeplySubstitutedClassParameter {
|
||||
|
||||
public interface Super<T> {
|
||||
@KotlinSignature("fun foo(): T")
|
||||
T foo();
|
||||
}
|
||||
|
||||
public interface Middle<E> extends Super<E> {
|
||||
E foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Middle<String> {
|
||||
String foo();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(): T
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
override fun foo(): E
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter : java.lang.Object {
|
||||
|
||||
public trait Middle</*0*/ E> : test.DeeplySubstitutedClassParameter.Super<E> {
|
||||
public abstract override /*1*/ fun foo() : E
|
||||
}
|
||||
|
||||
public trait Sub : test.DeeplySubstitutedClassParameter.Middle<jet.String> {
|
||||
public abstract override /*1*/ fun foo() : jet.String
|
||||
}
|
||||
|
||||
public trait Super</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo() : T
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public interface DeeplySubstitutedClassParameter2 {
|
||||
|
||||
public interface Super<T> {
|
||||
@KotlinSignature("fun foo(): T")
|
||||
T foo();
|
||||
}
|
||||
|
||||
public interface Middle<E> extends Super<E> {
|
||||
}
|
||||
|
||||
public interface Sub extends Middle<String> {
|
||||
String foo();
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter2: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(): T
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter2 : java.lang.Object {
|
||||
|
||||
public trait Middle</*0*/ E> : test.DeeplySubstitutedClassParameter2.Super<E> {
|
||||
public abstract override /*1*/ /*fake_override*/ fun foo() : E
|
||||
}
|
||||
|
||||
public trait Sub : test.DeeplySubstitutedClassParameter2.Middle<jet.String> {
|
||||
public abstract override /*1*/ fun foo() : jet.String
|
||||
}
|
||||
|
||||
public trait Super</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo() : T
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
public interface SubclassFromGenericAndNot {
|
||||
|
||||
public interface NonGeneric {
|
||||
String foo();
|
||||
}
|
||||
|
||||
public interface Generic<T> {
|
||||
@KotlinSignature("fun foo(): T")
|
||||
public T foo();
|
||||
}
|
||||
|
||||
public interface Sub extends NonGeneric, Generic<String> {
|
||||
@Override
|
||||
public String foo();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait SubclassFromGenericAndNot: Object {
|
||||
|
||||
public trait NonGeneric : Object {
|
||||
public fun foo(): String?
|
||||
}
|
||||
|
||||
public trait Generic<T> : Object {
|
||||
public fun foo(): T
|
||||
}
|
||||
|
||||
public trait Sub : NonGeneric, Generic<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait SubclassFromGenericAndNot : java.lang.Object {
|
||||
|
||||
public trait Generic</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo() : T
|
||||
}
|
||||
|
||||
public trait NonGeneric : java.lang.Object {
|
||||
public abstract fun foo() : jet.String?
|
||||
}
|
||||
|
||||
public trait Sub : test.SubclassFromGenericAndNot.NonGeneric, test.SubclassFromGenericAndNot.Generic<jet.String> {
|
||||
public abstract override /*2*/ fun foo() : jet.String
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public interface SubstitutedClassParameter {
|
||||
|
||||
public interface Super<T> {
|
||||
@KotlinSignature("fun foo(): T")
|
||||
T foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super<String> {
|
||||
String foo();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameter: Object {
|
||||
|
||||
public trait Super<T>: Object {
|
||||
public fun foo(): T
|
||||
}
|
||||
|
||||
public trait Sub: Super<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameter : java.lang.Object {
|
||||
|
||||
public trait Sub : test.SubstitutedClassParameter.Super<jet.String> {
|
||||
public abstract override /*1*/ fun foo() : jet.String
|
||||
}
|
||||
|
||||
public trait Super</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo() : T
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import jet.runtime.typeinfo.KotlinSignature;
|
||||
|
||||
import java.lang.String;
|
||||
|
||||
public interface SubstitutedClassParameters {
|
||||
|
||||
public interface Super1<T> {
|
||||
@KotlinSignature("fun foo(): T")
|
||||
T foo();
|
||||
}
|
||||
|
||||
public interface Super2<E> {
|
||||
@KotlinSignature("fun foo(): E")
|
||||
E foo();
|
||||
}
|
||||
|
||||
public interface Sub extends Super1<String>, Super2<String> {
|
||||
String foo();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameters: Object {
|
||||
|
||||
public trait Super1<T>: Object {
|
||||
public fun foo(): T
|
||||
}
|
||||
|
||||
public trait Super2<E>: Object {
|
||||
public fun foo(): E
|
||||
}
|
||||
|
||||
public trait Sub: Super1<String>, Super2<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameters : java.lang.Object {
|
||||
|
||||
public trait Sub : test.SubstitutedClassParameters.Super1<jet.String>, test.SubstitutedClassParameters.Super2<jet.String> {
|
||||
public abstract override /*2*/ fun foo() : jet.String
|
||||
}
|
||||
|
||||
public trait Super1</*0*/ T> : java.lang.Object {
|
||||
public abstract fun foo() : T
|
||||
}
|
||||
|
||||
public trait Super2</*0*/ E> : java.lang.Object {
|
||||
public abstract fun foo() : E
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user