[JVM_IR] Fix inline class default method codegen.
Do not coroutine transform static inline class replacements that forward to a default interface suspend method. No boxing has to take place on return (as the default interface method always boxes) so we can simply forward the call. ^KT-49645 Fixed
This commit is contained in:
committed by
Alexander Udalov
parent
50f610cfd8
commit
529944fe9c
@@ -0,0 +1,30 @@
|
||||
// WITH_STDLIB
|
||||
// WITH_COROUTINES
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
interface Cont1 {
|
||||
suspend fun flaf() = "O"
|
||||
|
||||
suspend fun toResult(): Result<String> {
|
||||
val x = flaf()
|
||||
return Result.success(x + "K")
|
||||
}
|
||||
}
|
||||
|
||||
@JvmInline
|
||||
private value class ContImpl(val a: String) : Cont1
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result = "FAIL"
|
||||
builder {
|
||||
result = ContImpl("A").toResult().getOrThrow()
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user