Move coroutines to kotlin.coroutines package: tests

Introduce COMMON_COROUTINES_TEST directive.
Every test with this directive is run twice: one time with
language version 1.2 and kotlin.coroutines.experimental package
and the other time with language version 1.3 and kotlin.coroutines
package. Each run is a separate method: with suffixes _1_2 and _1_3
respectively.
However, since codegen of release coroutines is not supported in JS
backend, we generate only one method: with suffix _1_2.
 #KT-23362
This commit is contained in:
Ilmir Usmanov
2018-04-19 17:10:47 +03:00
parent 30ab1e2b35
commit f60787d57c
340 changed files with 9150 additions and 3046 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import proguard.gradle.ProGuardTask
buildscript { buildscript {
extra["defaultSnapshotVersion"] = "1.2-SNAPSHOT" extra["defaultSnapshotVersion"] = "1.2-SNAPSHOT"
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.2.50-dev-310", onlySuccessBootstrap = false)) kotlinBootstrapFrom(BootstrapOption.TeamCity("1.2.50-dev-697", onlySuccessBootstrap = false))
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString() val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
@@ -1,8 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere( suspend fun suspendHere(
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
fun builder(c: suspend () -> Unit) { fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation) c.startCoroutine(EmptyContinuation)
+3 -2
View File
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
interface AsyncGenerator<in T> { interface AsyncGenerator<in T> {
suspend fun yield(value: T) suspend fun yield(value: T)
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
interface AsyncGenerator<in T> { interface AsyncGenerator<in T> {
suspend fun yield(value: T) suspend fun yield(value: T)
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
interface AsyncGenerator<in T> { interface AsyncGenerator<in T> {
suspend fun yield(value: T) suspend fun yield(value: T)
+7 -6
View File
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// FILE: promise.kt // FILE: promise.kt
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Promise<T>(private val executor: ((T) -> Unit) -> Unit) { class Promise<T>(private val executor: ((T) -> Unit) -> Unit) {
private var value: Any? = null private var value: Any? = null
@@ -51,8 +52,8 @@ fun processQueue() {
// FILE: await.kt // FILE: await.kt
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
private var log = "" private var log = ""
@@ -97,8 +98,8 @@ fun <T> asyncOperation(resultSupplier: () -> T) = Promise<T> { resolve ->
fun getLog() = log fun getLog() = log
// FILE: main.kt // FILE: main.kt
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
private fun test() = async<String> { private fun test() = async<String> {
val o = await(asyncOperation { "O" }) val o = await(asyncOperation { "O" })
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x -> } suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x -> }
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x ->} suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x ->}
fun builder(c: suspend () -> Unit) { fun builder(c: suspend () -> Unit) {
+3 -2
View File
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun <T> await(t: T): T = suspendCoroutineOrReturn { c -> suspend fun <T> await(t: T): T = suspendCoroutineOrReturn { c ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
fun builder(c: suspend () -> Unit): Unit { fun builder(c: suspend () -> Unit): Unit {
c.startCoroutine(handleResultContinuation { c.startCoroutine(handleResultContinuation {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var result = "" var result = ""
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.Continuation
import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var result = false var result = false
@@ -1,7 +1,8 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
inline fun inlinedLambda(block: () -> Unit) { inline fun inlinedLambda(block: () -> Unit) {
return block() return block()
@@ -1,10 +1,11 @@
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
// WITH_REFLECT // WITH_REFLECT
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class A<T : String> { class A<T : String> {
suspend fun foo() {} suspend fun foo() {}
@@ -29,5 +30,5 @@ fun box(): String {
result = A<String>().bar() result = A<String>().bar()
} }
return if (result == "(kotlin.coroutines.experimental.Continuation<T>) -> kotlin.Any?") "OK" else "Fail: $result" return if (result == "(COROUTINES_PACKAGE.Continuation<T>) -> kotlin.Any?") "OK" else "Fail: $result"
} }
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
fun builder(c: suspend () -> Unit) { fun builder(c: suspend () -> Unit) {
val x = c.createCoroutine(EmptyContinuation) val x = c.createCoroutine(EmptyContinuation)
@@ -1,7 +1,8 @@
// WITH_RUNTIME // WITH_RUNTIME
// IGNORE_BACKEND: JS // IGNORE_BACKEND: JS
import kotlin.coroutines.experimental.* // COMMON_COROUTINES_TEST
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED
fun runCustomLambdaAsCoroutine(e: Throwable? = null, x: (Continuation<String>) -> Any?): String { fun runCustomLambdaAsCoroutine(e: Throwable? = null, x: (Continuation<String>) -> Any?): String {
var result = "fail" var result = "fail"
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// COMMON_COROUTINES_TEST
// WITH_COROUTINES // WITH_COROUTINES
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
interface Consumer { fun consume(s: String) } interface Consumer { fun consume(s: String) }
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineOrReturn { x ->
+3 -2
View File
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var log = "" var log = ""
+3 -2
View File
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
var result = 0 var result = 0
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun <T> suspendHere(v: T): T = suspendCoroutineOrReturn { x -> suspend fun <T> suspendHere(v: T): T = suspendCoroutineOrReturn { x ->
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: NATIVE
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class A { class A {
var result = mutableListOf("O", "K", null) var result = mutableListOf("O", "K", null)
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.properties.Delegates import kotlin.properties.Delegates
class Pipe { class Pipe {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
data class A(val o: String) { data class A(val o: String) {
operator fun component2(): String = "K" operator fun component2(): String = "K"
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
class A(val w: String) { class A(val w: String) {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
class A(val w: String) { class A(val w: String) {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
data class A(val o: String) { data class A(val o: String) {
operator suspend fun component2(): String = suspendCoroutineOrReturn { x -> operator suspend fun component2(): String = suspendCoroutineOrReturn { x ->
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x -> suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x ->
x.resume(v) x.resume(v)
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x -> suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x ->
x.resume(v) x.resume(v)
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x -> suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x ->
x.resume(v) x.resume(v)
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
class CompilerKillingIterator<T, out R>(private val underlying: Iterator<T>, private val transform: suspend (e: T) -> Iterator<R>) { class CompilerKillingIterator<T, out R>(private val underlying: Iterator<T>, private val transform: suspend (e: T) -> Iterator<R>) {
private var currentIt: Iterator<R> = object : Iterator<R> { private var currentIt: Iterator<R> = object : Iterator<R> {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
class CompilerKillingIterator<T, out R>(private val underlying: Iterator<T>, private val transform: suspend (e: T) -> Iterator<R>) { class CompilerKillingIterator<T, out R>(private val underlying: Iterator<T>, private val transform: suspend (e: T) -> Iterator<R>) {
private var currentIt: Iterator<R> = object : Iterator<R> { private var currentIt: Iterator<R> = object : Iterator<R> {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
suspend fun ArrayList<Int>.yield(v: Int): Unit = suspendCoroutineOrReturn { x -> suspend fun ArrayList<Int>.yield(v: Int): Unit = suspendCoroutineOrReturn { x ->
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend infix fun Int.test(x : Int) : Int { tailrec suspend infix fun Int.test(x : Int) : Int {
if (this > 1) { if (this > 1) {
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend infix fun Int.foo(x: Int) { tailrec suspend infix fun Int.foo(x: Int) {
if (x == 0) return if (x == 0) return
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend fun <T, A> Iterator<T>.foldl(acc : A, foldFunction : (e : T, acc : A) -> A) : A = tailrec suspend fun <T, A> Iterator<T>.foldl(acc : A, foldFunction : (e : T, acc : A) -> A) : A =
if (!hasNext()) acc if (!hasNext()) acc
@@ -1,7 +1,8 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
suspend fun escapeChar(c : Char) : String? = when (c) { suspend fun escapeChar(c : Char) : String? = when (c) {
'\\' -> "\\\\" '\\' -> "\\\\"
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend fun String.repeat(num : Int, acc : StringBuilder = StringBuilder()) : String = tailrec suspend fun String.repeat(num : Int, acc : StringBuilder = StringBuilder()) : String =
if (num == 0) acc.toString() if (num == 0) acc.toString()
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend fun foo(x: Int) { tailrec suspend fun foo(x: Int) {
if (x == 0) return if (x == 0) return
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend fun sum(x: Long, sum: Long): Long { tailrec suspend fun sum(x: Long, sum: Long): Long {
if (x == 0.toLong()) return sum if (x == 0.toLong()) return sum
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend fun foo(x: Int) { tailrec suspend fun foo(x: Int) {
return if (x > 0) { return if (x > 0) {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend fun foo(x: Int) { tailrec suspend fun foo(x: Int) {
if (x == 0) return if (x == 0) return
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
// DONT_RUN_GENERATED_CODE: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
tailrec suspend fun withWhen(counter : Int, d : Any) : Int = tailrec suspend fun withWhen(counter : Int, d : Any) : Int =
if (counter == 0) { if (counter == 0) {
+3 -2
View File
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
// FULL_JDK // FULL_JDK
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
fun box(): String { fun box(): String {
val x = gen().joinToString() val x = gen().joinToString()
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var exception: Throwable? = null var exception: Throwable? = null
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
fun builder(c: suspend () -> Unit): String { fun builder(c: suspend () -> Unit): String {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var log = "" var log = ""
+3 -2
View File
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
x.resume(Unit) x.resume(Unit)
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
var stopped = false var stopped = false
var log = "" var log = ""
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendThere(v: Any?): String = suspendCoroutineOrReturn { x -> suspend fun suspendThere(v: Any?): String = suspendCoroutineOrReturn { x ->
x.resume(v?.toString() ?: "<empty>") x.resume(v?.toString() ?: "<empty>")
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// WITH_REFLECT // WITH_REFLECT
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
x.resume(v) x.resume(v)
@@ -1,13 +1,14 @@
// IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: NATIVE
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
// WITH_REFLECT // WITH_REFLECT
// CHECK_NOT_CALLED: suspendInline_61zpoe$ // CHECK_NOT_CALLED: suspendInline_61zpoe$
// CHECK_NOT_CALLED: suspendInline_6r51u9$ // CHECK_NOT_CALLED: suspendInline_6r51u9$
// CHECK_NOT_CALLED: suspendInline // CHECK_NOT_CALLED: suspendInline
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
fun withValue(v: String, x: Continuation<String>) { fun withValue(v: String, x: Continuation<String>) {
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
var globalResult = "" var globalResult = ""
var wasCalled = false var wasCalled = false
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var i = 0 var i = 0
@@ -1,10 +1,11 @@
// IGNORE_BACKEND: NATIVE // IGNORE_BACKEND: NATIVE
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
// WITH_REFLECT // WITH_REFLECT
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun runInstanceOf(): Boolean = suspendCoroutineOrReturn { x -> suspend fun runInstanceOf(): Boolean = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
// TARGET_BACKEND: JVM // TARGET_BACKEND: JVM
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
@@ -1,3 +1,4 @@
// !API_VERSION: 1.2
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
import helpers.* import helpers.*
@@ -1,3 +1,4 @@
// !API_VERSION: 1.2
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
import helpers.* import helpers.*
@@ -1,3 +1,4 @@
// !API_VERSION: 1.2
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
import helpers.* import helpers.*
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
suspend fun suspendHereUnintercepted(): String = suspendCoroutineUninterceptedOrReturn { x -> suspend fun suspendHereUnintercepted(): String = suspendCoroutineUninterceptedOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.test.assertEquals import kotlin.test.assertEquals
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
+3 -2
View File
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
// WITH_CONTINUATION // WITH_CONTINUATION
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun <V> suspendHere(v: V): V = suspendCoroutineOrReturn { x -> suspend fun <V> suspendHere(v: V): V = suspendCoroutineOrReturn { x ->
x.resume(v) x.resume(v)
+4 -3
View File
@@ -1,10 +1,11 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn
import kotlin.coroutines.experimental.startCoroutine import COROUTINES_PACKAGE.startCoroutine
class Bar(val x: Any) class Bar(val x: Any)
inline fun Any.map(transform: (Any) -> Any) { inline fun Any.map(transform: (Any) -> Any) {
+2 -1
View File
@@ -1,7 +1,8 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.startCoroutine import COROUTINES_PACKAGE.startCoroutine
class Controller { class Controller {
suspend inline fun suspendInlineThrow(v: String): String = throw RuntimeException(v) suspend inline fun suspendInlineThrow(v: String): String = throw RuntimeException(v)
+3 -2
View File
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
class A { class A {
var isMinusAssignCalled = false var isMinusAssignCalled = false
+2 -1
View File
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
interface Consumer { fun consume(s: String) } interface Consumer { fun consume(s: String) }
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var result = "" var result = ""
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
x.resume("OK") x.resume("OK")
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
x.resume("OK") x.resume("OK")
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
class Controller { class Controller {
var ok = false var ok = false
@@ -1,8 +1,9 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun suspendWithValue(result: () -> String): String = suspendCoroutineOrReturn { x -> suspend fun suspendWithValue(result: () -> String): String = suspendCoroutineOrReturn { x ->
x.resume(result()) x.resume(result())
+4 -3
View File
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn
class OkDelegate { class OkDelegate {
operator fun getValue(receiver: Any?, property: Any?): String = "OK" operator fun getValue(receiver: Any?, property: Any?): String = "OK"
@@ -1,9 +1,10 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// COMMON_COROUTINES_TEST
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import COROUTINES_PACKAGE.*
import kotlin.coroutines.experimental.intrinsics.* import COROUTINES_PACKAGE.intrinsics.*
suspend fun callLocal(a: String, b: String): String { suspend fun callLocal(a: String, b: String): String {
suspend fun local() = suspendCoroutineOrReturn<String> { suspend fun local() = suspendCoroutineOrReturn<String> {

Some files were not shown because too many files have changed in this diff Show More