Whoever decided to have both `Flow{ fun collect() ...
# flow
a
Whoever decided to have both
Flow{ fun collect() }
and
Flow.collect
(an extension function) needs to have a stern talking to.
I have IntelliJ telling me
import kotlinx.coroutines.flow.collect
is unused, and when I remove it, it tries to use the regular function, which the compiler doesn’t like.
and it’s always fun trying to import it
e
https://github.com/Kotlin/kotlinx.coroutines/pull/3047 Perhaps something is wrong with your setup, as
.collect {}
is usable in 1.6+ without an extension, and
.collect()
requires an extension in all versions
a
I'm using compose 1.1.1 which is kotlin 1.5 if I’m not mistaken.
e
what matters is kotlinx.coroutines version, not kotlin version
a
Clearing the cache solved the IntelliJ problem, btw.
e
but if you are seeing inconsistency between your ide and your compiler, they probably disagree on what version you're using
a
Doesn't IntelliJ take all the info from gradle?
e
it should, but clearly something went wrong in your case
a
Also, I didn’t add
kotlinx.coroutines
as a dependency, I’m just using the one brought in by
Copy code
implementation(compose.desktop.currentOs)