1.3 migration: make inspections working for non-experimental coroutines

This commit is contained in:
Mikhail Glukhikh
2018-07-23 18:55:51 +03:00
parent 76b9b579bc
commit cc1d9e88d5
16 changed files with 225 additions and 14 deletions
@@ -0,0 +1,48 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
interface Deferred<T> {
suspend fun await(): T
}
interface CoroutineContext
object DefaultDispatcher : CoroutineContext
enum class CoroutineStart {
DEFAULT,
LAZY,
ATOMIC,
UNDISPATCHED
}
interface Job
fun <T> async(
context: CoroutineContext = DefaultDispatcher,
start: CoroutineStart = CoroutineStart.DEFAULT,
parent: Job? = null,
f: suspend () -> T
): Deferred<T> {
TODO()
}
fun <T> runBlocking(
context: CoroutineContext = DefaultDispatcher,
f: suspend () -> T
) {
TODO()
}
suspend fun <T> withContext(
context: CoroutineContext,
start: CoroutineStart = CoroutineStart.DEFAULT,
f: suspend () -> T
) {
TODO()
}
suspend fun test(ctx: CoroutineContext) {
<caret>async(ctx) { 42 }.await()
}
@@ -0,0 +1,48 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
interface Deferred<T> {
suspend fun await(): T
}
interface CoroutineContext
object DefaultDispatcher : CoroutineContext
enum class CoroutineStart {
DEFAULT,
LAZY,
ATOMIC,
UNDISPATCHED
}
interface Job
fun <T> async(
context: CoroutineContext = DefaultDispatcher,
start: CoroutineStart = CoroutineStart.DEFAULT,
parent: Job? = null,
f: suspend () -> T
): Deferred<T> {
TODO()
}
fun <T> runBlocking(
context: CoroutineContext = DefaultDispatcher,
f: suspend () -> T
) {
TODO()
}
suspend fun <T> withContext(
context: CoroutineContext,
start: CoroutineStart = CoroutineStart.DEFAULT,
f: suspend () -> T
) {
TODO()
}
suspend fun test(ctx: CoroutineContext) {
withContext(ctx) { 42 }
}
@@ -1,6 +1,6 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T
@@ -1,6 +1,6 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T
@@ -1,6 +1,6 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T
@@ -1,6 +1,6 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T
@@ -1,7 +1,7 @@
// PROBLEM: none
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T
@@ -1,6 +1,6 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T
@@ -1,6 +1,6 @@
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T
@@ -1,7 +1,7 @@
// PROBLEM: none
// WITH_RUNTIME
package kotlinx.coroutines.experimental
package kotlinx.coroutines
interface Deferred<T> {
suspend fun await(): T