Support non-tail suspend calls in JVM back-end
#KT-15597 In Progress
This commit is contained in:
@@ -5,6 +5,21 @@ class Controller {
|
||||
suspend fun suspendHere() = suspendCoroutineOrReturn<String> { x ->
|
||||
x.resume("OK")
|
||||
}
|
||||
|
||||
suspend fun tailCall(): String {
|
||||
return suspendHere()
|
||||
}
|
||||
|
||||
suspend fun nonTailCall(): String {
|
||||
suspendHere()
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
suspend fun multipleSuspensions(): String {
|
||||
suspendHere()
|
||||
return suspendHere()
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
final class Controller$multipleSuspensions$1 {
|
||||
synthetic final field this$0: Controller
|
||||
inner class Controller$multipleSuspensions$1
|
||||
method <init>(p0: Controller, p1: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
}
|
||||
|
||||
final class Controller$nonTailCall$1 {
|
||||
synthetic final field this$0: Controller
|
||||
inner class Controller$nonTailCall$1
|
||||
method <init>(p0: Controller, p1: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class Controller {
|
||||
inner class Controller$multipleSuspensions$1
|
||||
inner class Controller$nonTailCall$1
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.Nullable method multipleSuspensions(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method nonTailCall(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method suspendHere(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method tailCall(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): java.lang.Object
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@@ -15,7 +34,7 @@ final class CoroutineFieldsKt$box$1 {
|
||||
method <init>(p0: kotlin.jvm.internal.Ref$ObjectRef, p1: kotlin.coroutines.Continuation): void
|
||||
public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: Controller, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
public synthetic method create(p0: java.lang.Object, p1: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation
|
||||
protected final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): java.lang.Object
|
||||
public final @org.jetbrains.annotations.Nullable method invoke(@org.jetbrains.annotations.NotNull p0: Controller, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
|
||||
public synthetic method invoke(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user