See <https://youtrack.jetbrains.com/issue/KT-17609...
# coroutines
e
l
Why is this marked as fixed? I'm using Kotlin 1.2.20 and kotlinx.coroutines 0.21.2 and I have no
coroutineContext
property available in suspending functions
Hum... I see I can import it manually from intrisics. But why is it not available from IDE autocomplete?
e
It is not ready yet. It will move to a “public” package. You can use a workaround with your own
coroutineContext()
function as described there.
l
What makes it "not ready"? i just tried my code using it with success, no hacks apart from manual import. Also, the
coroutineContext()
example in the issue also uses a method from the same package:
suspendCoroutineOrReturn
...
I only found it out on the linked GitHub issue (https://github.com/Kotlin/kotlinx.coroutines/issues/114)
e
Wrong package & not tested thoroughly yet.
l
How can I watch updates on this to know when it's ready to be used? Also, is the suspendCoroutineOrReturn approach from the same intrisic package safer to use?
e
intrinsic
package if so unsafe stuff.
Just watch updates on
kotlinx.coroutines
. It will be mentioned in release notes
l
So I should use the suspendCoroutine workaround approach for the time being, right?