Make fields representing variables in coroutines non-volatile

#KT-14636 Fixed
This commit is contained in:
Denis Zharkov
2016-11-08 11:21:08 +03:00
parent 7e49db8768
commit e54b466010
5 changed files with 60 additions and 2 deletions
@@ -0,0 +1,23 @@
class Controller {
suspend fun suspendHere(x: Continuation<String>) {
x.resume("OK")
}
}
fun builder(coroutine c: Controller.(String, Long) -> Continuation<Unit>) {
c(Controller(), "", 2L).resume(Unit)
}
fun box(): String {
var result = ""
builder { x, y ->
val z = ""
val u = 1L
result = suspendHere()
result += z + u
}
return result
}
@@ -0,0 +1,27 @@
@kotlin.Metadata
public final class Controller {
public method <init>(): void
public final method suspendHere(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): void
}
@kotlin.Metadata
final class CoroutineFieldsKt$box$1 {
synthetic final field $result: kotlin.jvm.internal.Ref$ObjectRef
private field J$0: long
private field L$0: java.lang.Object
private field L$1: java.lang.Object
private final field p$0: java.lang.String
private final field p$1: long
inner class CoroutineFieldsKt$box$1
method <init>(p0: kotlin.jvm.internal.Ref$ObjectRef): void
protected final method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): void
public final @org.jetbrains.annotations.NotNull method invoke(@org.jetbrains.annotations.NotNull p0: Controller, @org.jetbrains.annotations.NotNull p1: java.lang.String, p2: long): kotlin.coroutines.Continuation
public synthetic method invoke(p0: java.lang.Object, p1: java.lang.Object, p2: java.lang.Object): java.lang.Object
}
@kotlin.Metadata
public final class CoroutineFieldsKt {
inner class CoroutineFieldsKt$box$1
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.Function3): void
}