[JVM_IR] Do not use invoke-dynamic for targeting inline-only methods.

Fixes https://youtrack.jetbrains.com/issue/KT-46962
This commit is contained in:
Mads Ager
2021-05-31 14:56:53 +02:00
committed by teamcityserver
parent 5c2753b5d1
commit 886ce055f5
6 changed files with 49 additions and 0 deletions
@@ -0,0 +1,21 @@
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// SAM_CONVERSIONS: INDY
// WITH_RUNTIME
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 java/lang/invoke/LambdaMetafactory
fun interface Consumer {
fun foo(s: String)
}
fun call(c: Consumer) {
}
fun box(): String {
// println is inline only and therefore we cannot use invoke-dynamic to target it.
call(::println)
return "OK"
}