What does "intrinsic" implementation mean in Kotlin?
23:10 03 May 2022

When browsing through Kotlin source code, I found that in some places NotImplementedError is thrown:

public suspend inline val coroutineContext: CoroutineContext
    get() {
        throw NotImplementedError("Implemented as intrinsic")
    }
public suspend inline fun  suspendCoroutineUninterceptedOrReturn(crossinline block: (Continuation) -> Any?): T {
    contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }
    throw NotImplementedError("Implementation of suspendCoroutineUninterceptedOrReturn is intrinsic")
}

I assume these are not real not-implemented errors since otherwise code cannot run.

My questions are:

  • what does "intrinsic" mean here and why NotImplementedError is thrown?
  • where could I view the source code for these implementation?
kotlin kotlin-coroutines