Minor, add regression test

#KT-42554
This commit is contained in:
Alexander Udalov
2020-10-09 13:58:15 +02:00
parent 6f9f437f15
commit ac39e4d89c
8 changed files with 56 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
// WITH_RUNTIME
import kotlin.coroutines.*
fun launch(block: suspend () -> String): String {
var result = ""
block.startCoroutine(Continuation(EmptyCoroutineContext) { result = it.getOrThrow() })
return result
}
enum class E { A }
class C(val e: E) {
val result = launch {
when (e) {
E.A -> "OK"
}
}
}
fun box(): String = C(E.A).result