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

Matej Drobnič

07/30/2019, 1:49 PM
I guess it is pretty late for this, but wonder what is the reason to move Flow's functionality behind extension method, while method that should not be used is the regular interface method with the same name? When I type
emptyFlow<Unit>().collect
, method on the top of the list in IDE's completion will be the internal method that should not be used. At first IntelliJ did not suggest any extension methods to me. I was baffled since all examples just mention to call
.collect {}
, but all I got was method marked as internal with documentation saying to not use. Then on subsequent tries, IDE started suggesting extension methods, but it was not transparent process.
1
z

Zach Klippenstein (he/him) [MOD]

07/30/2019, 4:27 PM
Agreed, this is frustrating. It would be better if the “internal”
collect
did not show up in auto-complete at all, or at least appeared below the main extension version.
e

elizarov

07/30/2019, 4:52 PM
Auto-completion will be fixed.
👍 1
m

Matej Drobnič

07/30/2019, 7:09 PM
this seems like a huge hassle though, needing to also fix up auto-completion
wouldn't it be just simpler to call the interface method something else?
e

elizarov

07/30/2019, 9:18 PM
This is also a temporary measure. It might become normal public in the future.
👍 1
2 Views