Files
kotlin-fork/compiler/testData/codegen/box/bridges/objectClone.kt
T
Mikhail Glukhikh 2dc6467b5d [FIR] Modify signatures also from ERASED_COLLECTION_PARAMETER_SIGNATURES
In this commit we change value parameter type of containsAll, removeAll,
retainAll from Java collections. Originally it's Collection<?>,
we change it to Collection<T>

#KT-42340 Fixed
2020-10-28 18:09:11 +03:00

24 lines
446 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
import java.util.HashSet
interface A : Set<String>
class B : A, HashSet<String>() {
override fun clone(): B = throw AssertionError()
}
fun box(): String {
return try {
B().clone()
"Fail 1"
} catch (e: AssertionError) {
try {
val hs: HashSet<String> = B()
hs.clone()
"Fail 2"
} catch (e: AssertionError) {
"OK"
}
}
}