Files
kotlin-fork/compiler/testData/codegen/box/bridges/objectClone.kt
T
2014-10-13 19:24:59 +04:00

23 lines
421 B
Kotlin

// TARGET_BACKEND: JVM
import java.util.HashSet
trait 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 {
(B() : HashSet<String>).clone()
"Fail 2"
} catch (e: AssertionError) {
"OK"
}
}
}