https://kotlinlang.org logo
#announcements
Title
# announcements
d

dimsuz

09/11/2017, 9:59 PM
Hmm, according to this https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel-iterator/,
hasNext()
and
next()
are operators available to overloading? But they a not mentioned in kotlin reference - is this a missing documentation or am I understanding it wrong? https://kotlinlang.org/docs/reference/operator-overloading.html
k

karelpeeters

09/11/2017, 10:05 PM
If an object has those methods you can use it in a for loop so that's why they're called operators. Ie. you can use then like this:
for (x in myObject) { ... }
.
d

dimsuz

09/12/2017, 9:33 AM
Ok, understood, so a documentation page on Operator Overloading is missing these details, right?
k

karelpeeters

09/12/2017, 9:35 AM
I think so, yes. Maybe file an issue?
👍 1
d

dimsuz

09/12/2017, 9:36 AM
yep, I will!
2 Views