Implement coroutineContext intrinsic
This intrinsic allows coroutine to access its context without suspention and, furthermore, disabling tail-call optimization. KT-17609: Fixed
This commit is contained in:
@@ -45,6 +45,19 @@ import kotlin.coroutines.experimental.processBareContinuationResume
|
||||
public inline suspend fun <T> suspendCoroutineOrReturn(crossinline block: (Continuation<T>) -> Any?): T =
|
||||
throw NotImplementedError("Implementation is intrinsic")
|
||||
|
||||
/**
|
||||
* Continuation context of current coroutine.
|
||||
*
|
||||
* This allows the user code to not pass an extra [CoroutineContext] parameter in basic coroutine builders like [launch] and [async],
|
||||
* but still provide easy access to coroutine context.
|
||||
*/
|
||||
@SinceKotlin("1.2")
|
||||
@Suppress("WRONG_MODIFIER_TARGET")
|
||||
public inline suspend val coroutineContext: CoroutineContext
|
||||
get() {
|
||||
throw NotImplementedError("Implemented as intrinsic")
|
||||
}
|
||||
|
||||
/**
|
||||
* This value is used as a return value of [suspendCoroutineOrReturn] `block` argument to state that
|
||||
* the execution was suspended and will not return any result immediately.
|
||||
|
||||
Reference in New Issue
Block a user