https://kotlinlang.org logo
#coroutines
Title
# coroutines
e

Emil Kantis

03/26/2021, 6:57 PM
Hi! Does anyone know how I should be able to compare a return value with
COROUTINE_SUSPENDED
? I'm building an AOP-based logging interceptor and need to check if the return value of a reflective methodcall is
COROUTINE_SUSPENDED
🙂 Currently doing this by checking
if (result.toString() == "COROUTINE_SUSPENDED")
but it feels like I should be able to access the symbol directly..
l

louiscad

03/26/2021, 11:48 PM
I think retrofit2 code deals with that. Basically, you need to import the intrinsic, which the IDE will not suggest.
e

Emil Kantis

03/27/2021, 10:58 AM
Thanks, I'll try to figure out how they manage to do that. Simply adding the import doesn't seem to be enough Nvm, I tried to import from
kotlinx.coroutines.intrinsics
instead of
kotlin.coroutines.intrinsics
3 Views