Switch to 183 platform

This commit is contained in:
Vyacheslav Gerasimov
2018-12-06 20:16:58 +03:00
parent 5aa0b7d2aa
commit d84c5b1608
70 changed files with 698 additions and 698 deletions
@@ -0,0 +1,32 @@
@file:Suppress("UNUSED_PARAMETER")
import kotlin.coroutines.*
import org.jetbrains.annotations.BlockingContext
import kotlin.coroutines.experimental.buildSequence
import java.lang.Thread.sleep
suspend fun testFunction() {
@BlockingContext
val ctx = getContext()
// no warnings with @BlockingContext annotation on ctx object
withContext(ctx) {Thread.sleep (2)}
// no warnings with @BlockingContext annotation on getContext() method
withContext(getContext()) {Thread.sleep(3)}
withContext(getNonBlockingContext()) {
Thread.<warning descr="Inappropriate blocking method call">sleep</warning>(3);
}
}
@BlockingContext
fun getContext(): CoroutineContext = TODO()
fun getNonBlockingContext(): CoroutineContext = TODO()
suspend fun <T> withContext(
context: CoroutineContext,
f: suspend () -> T
) {
TODO()
}