Fix signature mapping for default suspend function from interface
Use jvm suspend function view in function codegen. Also use SUSPEND_FUNCTION_TO_JVM_VIEW slice if the value exists for the given key #KT-15552 Fixed
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
import kotlin.coroutines.startCoroutine
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
interface TestInterface {
|
||||
suspend fun toInt(): Int = suspendCoroutineOrReturn { x ->
|
||||
x.resume(56)
|
||||
SUSPENDED_MARKER
|
||||
}
|
||||
}
|
||||
|
||||
class TestClass2 : TestInterface {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = -1
|
||||
builder {
|
||||
result = TestClass2().toInt()
|
||||
}
|
||||
|
||||
if (result != 56) return "fail 1: $result"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user