78ca733c38
except tests that are not possible to add without some modifications in the test infra. See todos on the commented-out test declarations
34 lines
574 B
Kotlin
Vendored
34 lines
574 B
Kotlin
Vendored
// IGNORE_BACKEND: WASM
|
|
// WASM_MUTE_REASON: IGNORED_IN_JS
|
|
// IGNORE_BACKEND_K1: JS_IR
|
|
// IGNORE_BACKEND: JS_IR_ES6
|
|
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS
|
|
|
|
class It {
|
|
var hasNext = true
|
|
operator fun hasNext() = if (hasNext) {hasNext = false; true} else false
|
|
}
|
|
|
|
class C {
|
|
operator fun iterator(): It = It()
|
|
}
|
|
|
|
class X {
|
|
operator fun It.next() = 5
|
|
|
|
fun test() {
|
|
for (i in C()) {
|
|
foo(i)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
fun foo(x: Int) {}
|
|
|
|
fun box(): String {
|
|
X().test()
|
|
return "OK"
|
|
}
|