Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aleksandarzekovic/f486ec11c245fd46f9ed632c01042cc9 to your computer and use it in GitHub Desktop.
Save aleksandarzekovic/f486ec11c245fd46f9ed632c01042cc9 to your computer and use it in GitHub Desktop.
// kotlin/libraries/stdlib/jvm/src/kotlin/coroutines/intrinsics/IntrinsicsJvm.kt
@SinceKotlin("1.3")
public actual fun <R, T> (suspend R.() -> T).createCoroutineUnintercepted(
receiver: R,
completion: Continuation<T>
): Continuation<Unit> {
val probeCompletion = probeCoroutineCreated(completion)
return if (this is BaseContinuationImpl)
create(receiver, probeCompletion)
else {
createCoroutineFromSuspendFunction(probeCompletion) {
(this as Function2<R, Continuation<T>, Any?>).invoke(receiver, it)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment