KT-6815 Representing raw types when used as supertypes for Java classes

#KT-6815 Fixed
This commit is contained in:
Andrey Breslav
2015-03-02 19:31:02 +03:00
parent 7c62d8ed83
commit 61989ba245
14 changed files with 196 additions and 33 deletions
@@ -3,7 +3,7 @@ package test
public open class RawSuperType {
public constructor RawSuperType()
public open inner class Derived : test.RawSuperType.Super<*> {
public open inner class Derived : test.RawSuperType.Super<kotlin.Any?> {
public constructor Derived()
public open override /*1*/ fun dummy(): kotlin.Unit
public open override /*1*/ fun foo(/*0*/ p0: kotlin.Any!): kotlin.Unit
@@ -0,0 +1,31 @@
package test;
import java.lang.Object;
import java.lang.Override;
import java.lang.UnsupportedOperationException;
public class RawSuperTypeWithBound {
public interface Bound {}
public interface Super<T extends Bound> {
void foo(T t);
void dummy(); // To make it not SAM
}
public class Derived implements Super {
public void foo(Object o) {
throw new UnsupportedOperationException();
}
@Override
public void foo(Bound o) {
throw new UnsupportedOperationException();
}
@Override
public void dummy() {}
}
}
@@ -0,0 +1,20 @@
package test
public open class RawSuperTypeWithBound {
public constructor RawSuperTypeWithBound()
public trait Bound {
}
public open inner class Derived : test.RawSuperTypeWithBound.Super<test.RawSuperTypeWithBound.Bound!> {
public constructor Derived()
public open override /*1*/ fun dummy(): kotlin.Unit
public open fun foo(/*0*/ p0: kotlin.Any!): kotlin.Unit
public open override /*1*/ fun foo(/*0*/ p0: test.RawSuperTypeWithBound.Bound!): kotlin.Unit
}
public trait Super</*0*/ T : test.RawSuperTypeWithBound.Bound!> {
public abstract fun dummy(): kotlin.Unit
public abstract fun foo(/*0*/ p0: T!): kotlin.Unit
}
}
@@ -0,0 +1,29 @@
package test;
import java.lang.Object;
import java.lang.Override;
import java.lang.UnsupportedOperationException;
public class RawSuperTypeWithRecursiveBound {
public interface Super<T extends Super<T>> {
void foo(T t);
void dummy(); // To make it not SAM
}
public class Derived implements Super {
public void foo(Object o) {
throw new UnsupportedOperationException();
}
@Override
public void foo(Super o) {
throw new UnsupportedOperationException();
}
@Override
public void dummy() {}
}
}
@@ -0,0 +1,17 @@
package test
public open class RawSuperTypeWithRecursiveBound {
public constructor RawSuperTypeWithRecursiveBound()
public open inner class Derived : test.RawSuperTypeWithRecursiveBound.Super<test.RawSuperTypeWithRecursiveBound.Super<*>!> {
public constructor Derived()
public open override /*1*/ fun dummy(): kotlin.Unit
public open fun foo(/*0*/ p0: kotlin.Any!): kotlin.Unit
public open override /*1*/ fun foo(/*0*/ p0: test.RawSuperTypeWithRecursiveBound.Super<*>!): kotlin.Unit
}
public trait Super</*0*/ T : test.RawSuperTypeWithRecursiveBound.Super<T!>!> {
public abstract fun dummy(): kotlin.Unit
public abstract fun foo(/*0*/ p0: T!): kotlin.Unit
}
}
@@ -0,0 +1,29 @@
package test;
import java.lang.Object;
import java.lang.Override;
import java.lang.UnsupportedOperationException;
public class RawSuperTypeWithRecursiveBoundMultipleParameters {
public interface Super<R, T extends Super<R, T>> {
void foo(R r, T t);
void dummy(); // To make it not SAM
}
public class Derived implements Super {
public void foo(Object o, Object o1) {
throw new UnsupportedOperationException();
}
@Override
public void foo(Object r, Super t) {
throw new UnsupportedOperationException();
}
@Override
public void dummy() {}
}
}
@@ -0,0 +1,17 @@
package test
public open class RawSuperTypeWithRecursiveBoundMultipleParameters {
public constructor RawSuperTypeWithRecursiveBoundMultipleParameters()
public open inner class Derived : test.RawSuperTypeWithRecursiveBoundMultipleParameters.Super<kotlin.Any?, test.RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>!> {
public constructor Derived()
public open override /*1*/ fun dummy(): kotlin.Unit
public open fun foo(/*0*/ p0: kotlin.Any!, /*1*/ p1: kotlin.Any!): kotlin.Unit
public open override /*1*/ fun foo(/*0*/ p0: kotlin.Any!, /*1*/ p1: test.RawSuperTypeWithRecursiveBoundMultipleParameters.Super<*, *>!): kotlin.Unit
}
public trait Super</*0*/ R, /*1*/ T : test.RawSuperTypeWithRecursiveBoundMultipleParameters.Super<R!, T!>!> {
public abstract fun dummy(): kotlin.Unit
public abstract fun foo(/*0*/ p0: R!, /*1*/ p1: T!): kotlin.Unit
}
}