JVM_IR: unwrap suspend views when generating SAM wrappers
If the super class is in a file that has already been lowered, the base method has an extra continuation parameter which breaks things. Also, SAM wrappers around functional objects are tail-call and do not need continuations ever, so don't even try. ^KT-50950 Fixed
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
// WITH_COROUTINES
|
||||
// WITH_STDLIB
|
||||
// FILE: a.kt
|
||||
fun interface A {
|
||||
suspend fun run()
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
import helpers.EmptyContinuation
|
||||
|
||||
suspend fun run(block: suspend () -> Unit) = A(block).run()
|
||||
|
||||
fun box(): String {
|
||||
suspend {
|
||||
run {}
|
||||
}.startCoroutine(EmptyContinuation)
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user