JVM IR: add test for complex generic diamond hierarchy
This is a test for KT-43832, which is fixed in the previous commit.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// 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"
|
||||
}
|
||||
Reference in New Issue
Block a user