`onReceiveOrNull` defined on `ReceiveChannel` inte...
# coroutines
b
onReceiveOrNull
defined on
ReceiveChannel
interface is now deprecated, and
onReceiveOrNull
extension function defined on
ReceiveChannel
is now
ExperimentalCoroutinesApi
. I'm trying to use extension version of onReceiveOrNull but I can't. Is there anything wrong?
I'm using
kotlinx-coroutines-core:1.3.2
m
As real non extension functions are preferred over extension functions you can't call it with that name. You could do:
Copy code
import kotlinx.coroutines.channels.onRecieveOrNull as onRecieveOrNullExtension
And use
onRecieveOrNullExtension
instead of
onRecieveOrNull
b
Oh, it's Kotlin's grammatical rule,,,, Thanks! It works fine for me!