Introduce kotlin.Cloneable
- Cloneable is a trait with a single protected member 'clone', which is mapped to java.lang.Cloneable on JVM - 'clone' is non-abstract to be able to call 'super.clone()' in the implementations. Also if you need your class to be Cloneable, most of the time inheriting from Cloneable and calling 'super.clone()' will work - hack 'super.clone()' in JVM intrinsics and TImpl delegation generation - make arrays Cloneable, handle 'clone()' calls in the intrinsic #KT-4890 Fixed
This commit is contained in:
+1
-1
@@ -2,5 +2,5 @@ package test
|
||||
|
||||
public open class MissingUpperBound {
|
||||
public constructor MissingUpperBound()
|
||||
public open fun </*0*/ A : java.lang.Runnable?> foo(): kotlin.String? where A : java.lang.Cloneable?
|
||||
public open fun </*0*/ A : java.lang.Runnable?> foo(): kotlin.String? where A : kotlin.Cloneable?
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ package test
|
||||
|
||||
public open class WrongTypeParameterBoundStructure1 {
|
||||
public constructor WrongTypeParameterBoundStructure1()
|
||||
public open fun </*0*/ A, /*1*/ B : java.lang.Runnable?> foo(/*0*/ p0: A?, /*1*/ p1: kotlin.List<B>?): kotlin.Unit where B : kotlin.List<java.lang.Cloneable>?
|
||||
public open fun </*0*/ A, /*1*/ B : java.lang.Runnable?> foo(/*0*/ p0: A?, /*1*/ p1: kotlin.List<B>?): kotlin.Unit where B : kotlin.List<kotlin.Cloneable>?
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import jet.runtime.typeinfo.KotlinSignature;
|
||||
import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
||||
|
||||
public class WrongTypeParameterBoundStructure2 {
|
||||
@ExpectLoadError("'kotlin.List<java.lang.Cloneable>?' type in method signature has 1 type arguments, while 'List' in alternative signature has 0 of them")
|
||||
@ExpectLoadError("'kotlin.List<kotlin.Cloneable>?' type in method signature has 1 type arguments, while 'List' in alternative signature has 0 of them")
|
||||
@KotlinSignature("fun <A, B : Runnable> foo(a : A, b : List<B>) where B : List")
|
||||
public <A, B extends Runnable & List<Cloneable>> void foo(A a, List<? extends B> b) {
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ package test
|
||||
|
||||
public open class WrongTypeParameterBoundStructure2 {
|
||||
public constructor WrongTypeParameterBoundStructure2()
|
||||
public open fun </*0*/ A, /*1*/ B : java.lang.Runnable?> foo(/*0*/ p0: A?, /*1*/ p1: kotlin.List<B>?): kotlin.Unit where B : kotlin.List<java.lang.Cloneable>?
|
||||
public open fun </*0*/ A, /*1*/ B : java.lang.Runnable?> foo(/*0*/ p0: A?, /*1*/ p1: kotlin.List<B>?): kotlin.Unit where B : kotlin.List<kotlin.Cloneable>?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user