Remove coroutineContext from kotlin.coroutines.experimental.intrinsics package
#KT-22400: Fixed
This commit is contained in:
+7
-39
@@ -1,31 +1,17 @@
|
||||
// !API_VERSION: 1.2
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
import helpers.*
|
||||
import kotlin.coroutines.experimental.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
suspend fun suspendHereOld() =
|
||||
if (kotlin.coroutines.experimental.intrinsics.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.intrinsics.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
suspend fun suspendHereNew() =
|
||||
suspend fun suspendHere() =
|
||||
if (coroutineContext != EmptyCoroutineContext)
|
||||
"${coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
suspend fun multipleArgsOld(a: Any, b: Any, c: Any) =
|
||||
if (kotlin.coroutines.experimental.intrinsics.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.intrinsics.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
suspend fun multipleArgsNew(a: Any, b: Any, c: Any) =
|
||||
suspend fun multipleArgs(a: Any, b: Any, c: Any) =
|
||||
if (coroutineContext != EmptyCoroutineContext)
|
||||
"${coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
@@ -53,32 +39,14 @@ fun builder(c: suspend () -> String): String {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var res = builder { suspendHereOld() }
|
||||
var res = builder { suspendHere() }
|
||||
if (res != "OK") {
|
||||
return "fail 1 $res"
|
||||
}
|
||||
res = builder { multipleArgsOld(1, 1, 1) }
|
||||
res = builder { multipleArgs(1, 1, 1) }
|
||||
if (res != "OK") {
|
||||
return "fail 2 $res"
|
||||
}
|
||||
res = builder {
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
if (kotlin.coroutines.experimental.intrinsics.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.intrinsics.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
}
|
||||
if (res != "OK") {
|
||||
return "fail 3 $res"
|
||||
}
|
||||
res = builder { suspendHereNew() }
|
||||
if (res != "OK") {
|
||||
return "fail 4 $res"
|
||||
}
|
||||
res = builder { multipleArgsNew(1, 1, 1) }
|
||||
if (res != "OK") {
|
||||
return "fail 5 $res"
|
||||
}
|
||||
res = builder {
|
||||
if (coroutineContext != EmptyCoroutineContext)
|
||||
"${coroutineContext} != $EmptyCoroutineContext"
|
||||
@@ -86,7 +54,7 @@ fun box(): String {
|
||||
"OK"
|
||||
}
|
||||
if (res != "OK") {
|
||||
return "fail 6 $res"
|
||||
return "fail 3 $res"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
|
||||
+12
-44
@@ -1,34 +1,20 @@
|
||||
// !API_VERSION: 1.2
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
import helpers.*
|
||||
import kotlin.coroutines.experimental.*
|
||||
import kotlin.coroutines.experimental.intrinsics.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
class Controller {
|
||||
suspend fun controllerSuspendHereOld() =
|
||||
if (kotlin.coroutines.experimental.intrinsics.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.intrinsics.coroutineContext} != $EmptyCoroutineContext"
|
||||
suspend fun controllerSuspendHere() =
|
||||
if (coroutineContext != EmptyCoroutineContext)
|
||||
"${coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
suspend fun controllerMultipleArgsOld(a: Any, b: Any, c: Any) =
|
||||
if (kotlin.coroutines.experimental.intrinsics.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.intrinsics.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
suspend fun controllerSuspendHereNew() =
|
||||
if (kotlin.coroutines.experimental.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
suspend fun controllerMultipleArgsNew(a: Any, b: Any, c: Any) =
|
||||
if (kotlin.coroutines.experimental.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.coroutineContext} != $EmptyCoroutineContext"
|
||||
suspend fun controllerMultipleArgs(a: Any, b: Any, c: Any) =
|
||||
if (coroutineContext != EmptyCoroutineContext)
|
||||
"${coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
@@ -54,41 +40,23 @@ class Controller {
|
||||
|
||||
fun box(): String {
|
||||
val c = Controller()
|
||||
var res = c.builder { controllerSuspendHereOld() }
|
||||
var res = c.builder { controllerSuspendHere() }
|
||||
if (res != "OK") {
|
||||
return "fail 1 $res"
|
||||
}
|
||||
res = c.builder { controllerMultipleArgsOld(1, 1, 1) }
|
||||
res = c.builder { controllerMultipleArgs(1, 1, 1) }
|
||||
if (res != "OK") {
|
||||
return "fail 2 $res"
|
||||
}
|
||||
res = c.builder {
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
if (kotlin.coroutines.experimental.intrinsics.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.intrinsics.coroutineContext} != $EmptyCoroutineContext"
|
||||
if (coroutineContext != EmptyCoroutineContext)
|
||||
"${coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
}
|
||||
if (res != "OK") {
|
||||
return "fail 3 $res"
|
||||
}
|
||||
res = c.builder { controllerSuspendHereNew() }
|
||||
if (res != "OK") {
|
||||
return "fail 4 $res"
|
||||
}
|
||||
res = c.builder { controllerMultipleArgsNew(1, 1, 1) }
|
||||
if (res != "OK") {
|
||||
return "fail 5 $res"
|
||||
}
|
||||
res = c.builder {
|
||||
if (kotlin.coroutines.experimental.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
}
|
||||
if (res != "OK") {
|
||||
return "fail 6 $res"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+3
-24
@@ -1,9 +1,8 @@
|
||||
// !API_VERSION: 1.2
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
import helpers.*
|
||||
import kotlin.coroutines.experimental.*
|
||||
import kotlin.coroutines.experimental.intrinsics.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
@@ -20,18 +19,6 @@ class Controller {
|
||||
suspend fun controllerSuspendHere() =
|
||||
if (coroutineContext == EmptyCoroutineContext) "$coroutineContext == $EmptyCoroutineContext" else "OK"
|
||||
|
||||
suspend fun controllerSuspendHereIntrinsicOld() =
|
||||
if (kotlin.coroutines.experimental.intrinsics.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.intrinsics.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
suspend fun controllerSuspendHereIntrinsicNew() =
|
||||
if (kotlin.coroutines.experimental.coroutineContext != EmptyCoroutineContext)
|
||||
"${kotlin.coroutines.experimental.coroutineContext} != $EmptyCoroutineContext"
|
||||
else
|
||||
"OK"
|
||||
|
||||
suspend fun controllerMultipleArgs(a: Any, b: Any, c: Any) =
|
||||
if (coroutineContext == EmptyCoroutineContext) "$coroutineContext == $EmptyCoroutineContext" else "OK"
|
||||
|
||||
@@ -65,17 +52,9 @@ fun box(): String {
|
||||
if (res != "OK") {
|
||||
return "fail 2 $res"
|
||||
}
|
||||
res = v.builder { controllerSuspendHereIntrinsicOld() }
|
||||
if (res != "OK") {
|
||||
return "fail 3 $res"
|
||||
}
|
||||
res = v.builder { controllerSuspendHereIntrinsicNew() }
|
||||
if (res != "OK") {
|
||||
return "fail 4 $res"
|
||||
}
|
||||
res = v.builder { controllerSuspendHere() }
|
||||
if (res != "OK") {
|
||||
return "fail 5 $res"
|
||||
return "fail 3 $res"
|
||||
}
|
||||
|
||||
return "OK"
|
||||
|
||||
Reference in New Issue
Block a user