JVM IR: Use INVOKESPECIAL instead of INVOKEVIRTUAL for default private

suspend functions.

 #KT-26592
This commit is contained in:
Ilmir Usmanov
2021-02-23 15:59:51 +01:00
parent 3ee62cb1b2
commit d44799fa78
6 changed files with 58 additions and 1 deletions
@@ -0,0 +1,34 @@
// WITH_RUNTIME
// !JVM_DEFAULT_MODE: all
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
// IGNORE_BACKEND: JVM
import kotlin.coroutines.*
interface Foo {
private suspend fun test(): String {
return "OK"
}
suspend fun foo(): String {
return test()
}
}
fun builder(c: suspend () -> Unit) {
c.startCoroutine(Continuation(EmptyCoroutineContext) {
it.getOrThrow()
})
}
fun box(): String {
var res = "FAIL"
builder {
val foo: Foo = object : Foo{}
res = foo.foo()
}
return res
}