does anyone know how `suspendCoroutineUnintercepte...
# coroutines
f
does anyone know how
suspendCoroutineUninterceptedOrReturn
or
intercepted
is generated in coroutine library? I’m confused about why some core functions are auto-gen… Any specific reason?
e
What exactly you what to know? What do you mean by “autogenerated”?
f
Hi @elizarov, because i am studying the implementation of kotlin coroutines and found some core functions like
suspendCoroutineUninterceptedOrReturn
throwing
NotImplementedError("Implementation of suspendCoroutineUninterceptedOrReturn is intrinsic")
. I am just curious where is the “real” implementation of those intrinsic functions and why kotlin has such design. It is very interesting. I can’t find them directly in the code base
e
They are intrinsic, which means they are implemented by compiler. This particular function does not actually do anything. It is just a syntactic trick to expose coroutines calling convention. You can read more about it here: https://github.com/Kotlin/kotlin-coroutines/blob/master/kotlin-coroutines-informal.md#implementation-details
f
thanks Roman, reading the document!