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:
Alexander Udalov
2020-12-08 20:37:18 +01:00
parent 3370fa03d7
commit 3e0efeef31
9 changed files with 74 additions and 0 deletions
@@ -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"
}