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"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
@kotlin.Metadata
|
||||
public final class CoroutineUtilKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method handleExceptionContinuation(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): kotlin.coroutines.Continuation
|
||||
public final static @org.jetbrains.annotations.NotNull method handleResultContinuation(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): kotlin.coroutines.Continuation
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public class EmptyContinuation {
|
||||
public final static field Companion: EmptyContinuation.Companion
|
||||
private final @org.jetbrains.annotations.NotNull field context: kotlin.coroutines.CoroutineContext
|
||||
inner class EmptyContinuation/Companion
|
||||
public @synthetic.kotlin.jvm.GeneratedByJvmOverloads method <init>(): void
|
||||
public method <init>(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.CoroutineContext): void
|
||||
public synthetic method <init>(p0: kotlin.coroutines.CoroutineContext, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void
|
||||
public @org.jetbrains.annotations.NotNull method getContext(): kotlin.coroutines.CoroutineContext
|
||||
public method resume(@org.jetbrains.annotations.Nullable p0: java.lang.Object): void
|
||||
public method resumeWithException(@org.jetbrains.annotations.NotNull p0: java.lang.Throwable): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final static class EmptyContinuation/Companion {
|
||||
inner class EmptyContinuation/Companion
|
||||
private method <init>(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class SuspendDefaultImplKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static method builder(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function1): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestClass2 {
|
||||
public method <init>(): void
|
||||
public @org.jetbrains.annotations.Nullable method toInt(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public interface TestInterface {
|
||||
inner class TestInterface/DefaultImpls
|
||||
public abstract @org.jetbrains.annotations.Nullable method toInt(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class TestInterface/DefaultImpls {
|
||||
inner class TestInterface/DefaultImpls
|
||||
public static @org.jetbrains.annotations.Nullable method toInt(@org.jetbrains.annotations.NotNull p0: TestInterface, p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
Reference in New Issue
Block a user