Files
kotlin-fork/compiler/testData/codegen/box/traits/doubleGenericDiamond.kt
T
Alexander Udalov 3e0efeef31 JVM IR: add test for complex generic diamond hierarchy
This is a test for KT-43832, which is fixed in the previous commit.
2020-12-09 10:52:18 +01:00

35 lines
493 B
Kotlin
Vendored

// FILE: lib.kt
var result = ""
interface Left
interface Right
class Bottom : Left, Right
interface A<T> {
fun f(): T? {
result = "A"
return null
}
}
interface B<T : Left> : A<T> {
override fun f(): T? {
result = "B"
return null
}
}
abstract class C<T> : A<T>
abstract class D<T : Right> : C<T>()
// FILE: box.kt
class Z : D<Bottom>(), B<Bottom>
fun box(): String {
Z().f()
return if (result == "B") "OK" else "Fail: $result"
}