JVM_IR: use indy SAM conversions in jvmTarget 1.8+, fix bridges

KT-44278 KT-26060 KT-42621
This commit is contained in:
Dmitry Petrov
2021-02-05 15:23:04 +03:00
parent 6c6d43c29a
commit 3ebeca5852
50 changed files with 1293 additions and 287 deletions
@@ -0,0 +1,32 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
fun interface IFooT<T> {
fun foo(x: T): T
}
fun interface IFooInt {
fun foo(x: Int): Int
}
fun interface IFooMixed0 : IFooInt, IFooT<Int>
fun interface IFooMixed1 : IFooInt, IFooT<Int> {
override fun foo(x: Int): Int
}
fun box(): String {
val f0 = IFooMixed0 { it * 2 }
if (f0.foo(21) != 42)
return "Failed: f0.foo(21)=${f0.foo(21)}"
val f1 = IFooMixed1 { it * 2 }
if (f1.foo(21) != 42)
return "Failed: f1.foo(21)=${f1.foo(21)}"
return "OK"
}