JVM_IR: fix bound suspend-converted references

Note: inlining of adapted callable references is still suboptimal.

 #KT-42021 Fixed
This commit is contained in:
pyos
2020-09-22 11:53:29 +02:00
committed by max-kammerer
parent ac50433e17
commit 0e8a664c9b
12 changed files with 69 additions and 14 deletions
@@ -1,14 +1,10 @@
// !LANGUAGE: +SuspendConversion
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun runSuspend(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
@@ -0,0 +1,24 @@
// !LANGUAGE: +SuspendConversion
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun runSuspend(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
class C {
var test = "failed"
}
fun C.foo() {
test = "OK"
}
fun box(): String {
val c = C()
runSuspend(c::foo)
return c.test
}
@@ -1,14 +1,10 @@
// !LANGUAGE: +SuspendConversion
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun runSuspend(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}