was just poking around in kotlinx-coroutines. Saw...
# coroutines
p
was just poking around in kotlinx-coroutines. Saw
Copy code
/**
 * Returns the context of the current coroutine.
 */
@SinceKotlin("1.3")
@Suppress("WRONG_MODIFIER_TARGET")
@InlineOnly
public suspend inline val coroutineContext: CoroutineContext
    get() {
        throw NotImplementedError("Implemented as intrinsic")
    }
That is a wild bit of code. How does a
suspend inline val
exist in the language, and how is it that all it takes to make it work is to suppress the compiler warning that that’s not allowed?
e
the definition here is just to make the name and type available to the frontend; the compiler backend recognizes the intrinsic name and replaces it with an implementation that cannot be expressed in pure Kotlin
👍 1
😮 1