Minor. Use coroutine test helpers for inline/diagnostics tests
It should help with decreasing test data copy-pasting when testing against release / pre-release coroutines
This commit is contained in:
+1
-7
@@ -18,13 +18,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
var result = ""
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object : Continuation<Unit> {
|
||||
override val context = EmptyCoroutineContext
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
suspend inline fun test1(c: suspend () -> Unit) {
|
||||
c()
|
||||
@@ -18,19 +20,10 @@ suspend inline fun test2(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun calculate() = suspendCoroutineOrReturn<String> {
|
||||
|
||||
+3
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
inline suspend fun foo(crossinline a: suspend () -> Unit, crossinline b: suspend () -> Unit) {
|
||||
var x = "OK"
|
||||
@@ -15,17 +17,7 @@ inline suspend fun bar(crossinline l: suspend () -> Unit) {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
+4
-11
@@ -1,9 +1,11 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
class Controller {
|
||||
var res = "FAIL 1"
|
||||
@@ -39,19 +41,10 @@ suspend inline fun test3(controller: Controller = defaultController, crossinline
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
+4
-11
@@ -1,9 +1,11 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
class Controller {
|
||||
var res = "FAIL 1"
|
||||
@@ -19,19 +21,10 @@ suspend inline fun test(controller: Controller = defaultController, c: suspend C
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
+3
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
// Are suspend calls possible inside lambda matching to the parameter
|
||||
@@ -26,17 +28,7 @@ inline fun test2(crossinline c: suspend () -> Unit) {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
+2
-12
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
// Start coroutine call is possible
|
||||
@@ -13,18 +15,6 @@ inline fun test1(noinline c: suspend () -> Unit) {
|
||||
builder { l() }
|
||||
}
|
||||
|
||||
val EmptyContinuation = object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
}
|
||||
|
||||
inline fun test2(noinline c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
suspend inline fun test1(c: () -> Unit) {
|
||||
@@ -38,19 +39,9 @@ suspend inline fun test5(crossinline c: suspend() -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.jvm.internal.*
|
||||
|
||||
object EmptyContinuation: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
|
||||
+4
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
@@ -30,23 +32,14 @@ inline fun transform(crossinline c: suspend () -> Unit) {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun box() : String {
|
||||
var res = "FAIL 1"
|
||||
|
||||
+4
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
@@ -34,19 +36,10 @@ suspend inline fun test3(crossinline c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
+4
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
@@ -30,23 +32,14 @@ inline fun transform(crossinline c: suspend () -> Unit) {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun box() : String {
|
||||
var res = "FAIL 1"
|
||||
|
||||
+3
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
// Are suspend calls possible inside lambda matching to the parameter
|
||||
@@ -14,17 +16,6 @@ suspend inline fun test1(noinline c: suspend () -> Unit) {
|
||||
builder { l() }
|
||||
}
|
||||
|
||||
object EmptyContinuation: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
}
|
||||
|
||||
suspend inline fun test2(noinline c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
@@ -55,6 +46,7 @@ suspend inline fun test4(noinline c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// suspend calls possible inside lambda matching to the parameter
|
||||
@@ -13,17 +15,7 @@ suspend inline fun test(c: () -> Unit) {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
inline fun transform(crossinline c: suspend () -> Unit) {
|
||||
@@ -34,6 +26,7 @@ inline fun transform(crossinline c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// suspend calls possible inside lambda matching to the parameter
|
||||
@@ -16,19 +18,10 @@ suspend inline fun test(c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
object Result {
|
||||
@@ -58,19 +59,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun dummy() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
suspend inline fun inlineMe(c: suspend () -> Unit) {
|
||||
@@ -29,19 +30,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
+3
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
// Are suspend calls possible inside lambda matching to the parameter
|
||||
@@ -30,17 +32,7 @@ class Controller {
|
||||
}
|
||||
|
||||
fun builder(controller: Controller, c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(controller, object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
+2
-12
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
// Start coroutine call is possible
|
||||
@@ -12,18 +14,6 @@ interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
}
|
||||
|
||||
val EmptyContinuation = object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
}
|
||||
|
||||
class Controller {
|
||||
var res = "FAIL 1"
|
||||
|
||||
|
||||
+4
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
@@ -34,23 +36,14 @@ class Controller {
|
||||
}
|
||||
|
||||
fun builder(controller : Controller, c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(controller, object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun box() : String {
|
||||
val controller = Controller()
|
||||
|
||||
+4
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
@@ -38,19 +40,10 @@ class Controller {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(controller: Controller, c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(controller, object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
+4
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
@@ -34,23 +36,14 @@ class Controller {
|
||||
}
|
||||
|
||||
fun builder(controller: Controller, c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(controller, object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun box() : String {
|
||||
val controller = Controller()
|
||||
|
||||
+3
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
// Are suspend calls possible inside lambda matching to the parameter
|
||||
@@ -13,17 +15,6 @@ interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
}
|
||||
|
||||
object EmptyContinuation: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
}
|
||||
|
||||
class Controller {
|
||||
var res = "FAIL 1"
|
||||
@@ -59,6 +50,7 @@ fun builder(controller: Controller, c: suspend Controller.() -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
|
||||
+4
-11
@@ -1,9 +1,11 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// suspend calls possible inside lambda matching to the parameter
|
||||
@@ -21,23 +23,14 @@ class Controller {
|
||||
}
|
||||
|
||||
fun builder(controller: Controller, c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(controller, object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
|
||||
+4
-11
@@ -1,9 +1,11 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called inside the body of owner inline function
|
||||
// suspend calls possible inside lambda matching to the parameter
|
||||
@@ -20,19 +22,10 @@ class Controller {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(controller: Controller, c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(controller, object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun calculate() = "OK"
|
||||
|
||||
+4
-11
@@ -1,9 +1,11 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
inline suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||
x.resume(v)
|
||||
@@ -20,19 +22,10 @@ suspend inline fun complexSuspend(crossinline c: suspend () -> String): String {
|
||||
// COMMON_COROUTINES_TEST
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun suspendHere(): String = suspendThere("O")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
@@ -13,19 +14,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
+3
-11
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
@@ -18,19 +19,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
+4
-11
@@ -1,9 +1,11 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
var i = 0;
|
||||
|
||||
@@ -27,19 +29,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
interface SuspendRunnable {
|
||||
@@ -40,19 +41,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
+3
-11
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
interface SuspendRunnable {
|
||||
@@ -19,19 +20,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
interface SuspendRunnable {
|
||||
@@ -21,19 +22,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
+3
-11
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
interface SuspendRunnable {
|
||||
@@ -26,19 +27,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
+3
-11
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
interface SuspendRunnable {
|
||||
@@ -26,19 +27,10 @@ suspend inline fun crossinlineMe(crossinline c1: suspend () -> Unit, crossinline
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
Vendored
+4
-11
@@ -1,9 +1,11 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
var i = 0;
|
||||
|
||||
@@ -33,19 +35,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
@@ -13,19 +14,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
suspend inline fun inlineMe(c: suspend (String) -> String, d: suspend () -> String): String {
|
||||
@@ -19,19 +20,10 @@ suspend inline fun crossinlineMe(crossinline c: suspend (String) -> String, cros
|
||||
// COMMON_COROUTINES_TEST
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
suspend fun yieldString(s: String) = s
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_COROUTINES
|
||||
// SKIP_TXT
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
// Function is NOT suspend
|
||||
// parameter is crossinline
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -NOTHING_TO_INLINE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
// Function is NOT suspend
|
||||
// parameter is noinline
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -NOTHING_TO_INLINE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
// Function is NOT suspend
|
||||
// parameter is inline
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -NOTHING_TO_INLINE -UNUSED_PARAMETER
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
// Function is suspend
|
||||
// parameter is crossinline
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -NOTHING_TO_INLINE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
// Function is suspend
|
||||
// parameter is noinline
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -NOTHING_TO_INLINE -UNUSED_PARAMETER
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
|
||||
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
// Function is suspend
|
||||
// parameter is inline
|
||||
|
||||
compiler/testData/diagnostics/testsWithStdLib/coroutines/inlineCrossinline/inlineSuspendOfSuspend.kt
Vendored
+2
-6
@@ -1,14 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -NOTHING_TO_INLINE
|
||||
// COMMON_COROUTINES_TEST
|
||||
// SKIP_TXT
|
||||
// WITH_COROUTINES
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
open class EmptyContinuation(override val context: CoroutineContext = EmptyCoroutineContext) : Continuation<Any?> {
|
||||
companion object : EmptyContinuation()
|
||||
override fun resume(<!PARAMETER_NAME_CHANGED_ON_OVERRIDE!>data<!>: Any?) {}
|
||||
override fun resumeWithException(exception: Throwable) { throw exception }
|
||||
}
|
||||
import helpers.*
|
||||
|
||||
interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.diagnostics.*
|
||||
import org.jetbrains.kotlin.load.java.InternalFlexibleTypeTransformer
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.resolve.BindingContext
|
||||
@@ -220,6 +221,8 @@ abstract class BaseDiagnosticsTest : KotlinMultiFileTestWithJava<TestModule, Tes
|
||||
return true
|
||||
}
|
||||
|
||||
if (ktFile.name.endsWith("CoroutineUtil.kt") && ktFile.packageFqName == FqName("helpers")) return true
|
||||
|
||||
// TODO: report JVM signature diagnostics also for implementing modules
|
||||
val jvmSignatureDiagnostics = if (skipJvmSignatureDiagnostics)
|
||||
emptySet<ActualDiagnostic>()
|
||||
|
||||
Reference in New Issue
Block a user