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

groostav

01/03/2019, 9:11 PM
I'm getting really annoyed by intelliJ's debugger's evaluate expression refusing to run
channel.isClosedForReceive
because
This declaration is experimental and its usage must be marked with '@kotlinx.coroutines.InternalCoroutinesApi' or '@UseExperimental(kotlinx.coroutines.InternalCoroutinesApi::class)'
any help?
b

bdawg.io

01/03/2019, 9:25 PM
You need to explicitly opt-in to use an
InternalCoroutinesApi
. You should use the add
@UseExperimental...
suggestion
g

groostav

01/03/2019, 9:26 PM
how do I do that to the evaluate expression dialog?
b

bdawg.io

01/03/2019, 9:29 PM
Try adding
@UseExperimental(kotlinx.coroutines.InternalCoroutinesApi::class)
to the beginning of your evaluation
g

groostav

01/03/2019, 9:34 PM
I didnt think that was legal kotlin, I didnt realize you could put annotations on arbitrary
expr
elements (maybe thats just a debugger thing?)
but no good
message has been deleted
d

Dico

01/04/2019, 5:07 AM
Yeah, they should consider removing this limitation from the debugger.
b

bdawg.io

01/04/2019, 5:59 AM
Try adding it to your compiler arguments
-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi
I wouldn't recommend committing it though
3 Views