mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 00:21:28 +00:00
- initialize environment only once in setUp() - add comments on why some tests are disabled - modify and rename some tests - re-enable now working tests - extract some tests into files with box() - remove useless 'throws' declarations and commented code
26 lines
331 B
Kotlin
26 lines
331 B
Kotlin
class It {
|
|
fun next() = 5
|
|
}
|
|
|
|
class C {
|
|
fun iterator(): It = It()
|
|
}
|
|
|
|
class X {
|
|
var hasNext = true
|
|
fun It.hasNext() = if (hasNext) {hasNext = false; true} else false
|
|
|
|
fun test() {
|
|
for (i in C()) {
|
|
foo(i)
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
fun foo(x: Int) {}
|
|
|
|
fun main(args: Array<String>) {
|
|
X().test()
|
|
}
|