fbf9f5f7d0
Otherwise an assertion is failing in the algorithm which is related to an inconsistency of java.lang.Object inheritance in JDR (KT-4890)
22 lines
398 B
Kotlin
22 lines
398 B
Kotlin
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"
|
|
}
|
|
}
|
|
}
|