-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// WITH_STDLIB | ||
// WITH_COROUTINES | ||
import helpers.* | ||
import kotlin.coroutines.* | ||
import kotlin.coroutines.intrinsics.* | ||
|
||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> | ||
x.resume(Unit) | ||
COROUTINE_SUSPENDED | ||
} | ||
|
||
fun builder(c: suspend () -> Unit) { | ||
c.startCoroutine(EmptyContinuation) | ||
} | ||
|
||
class Data(val x: Int) | ||
|
||
fun box(): String { | ||
var result = "" | ||
|
||
builder { | ||
var data = Data(0) | ||
var done = false | ||
do { | ||
data = Data(1) | ||
suspendHere() | ||
done = true | ||
} while (!done) | ||
result = if (data.x == 1) "OK" else "fail" | ||
} | ||
|
||
return result | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.