Files
kotlin-fork/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.kt
T
Vladimir Sukharev 3aa6c9e74d [K/N] Run irText tests for K1/Native
^KT-58240
2023-09-05 11:42:45 +00:00

23 lines
477 B
Kotlin
Vendored

// WITH_STDLIB
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// KT-61141: `println (message: kotlin.Any?)` instead of `println (message: kotlin.Int)`
// IGNORE_BACKEND: NATIVE
object FiveTimes
class IntCell(var value: Int)
interface IReceiver {
operator fun FiveTimes.iterator() = IntCell(5)
operator fun IntCell.hasNext() = value > 0
operator fun IntCell.next() = value--
}
fun IReceiver.test() {
for (i in FiveTimes) {
println(i)
}
}