mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
21 lines
380 B
Kotlin
Vendored
21 lines
380 B
Kotlin
Vendored
fun testFor() {
|
|
operator fun Nothing.iterator() = (0..1).iterator()
|
|
|
|
<!UNREACHABLE_CODE!>for (i in<!> todo()<!UNREACHABLE_CODE!>) {}<!>
|
|
}
|
|
|
|
fun testWhile() {
|
|
<!UNREACHABLE_CODE!>while (<!>todo()<!UNREACHABLE_CODE!>) {
|
|
}<!>
|
|
}
|
|
|
|
fun testDoWhile() {
|
|
do {
|
|
|
|
} while(todo())
|
|
|
|
<!UNREACHABLE_CODE!>bar()<!>
|
|
}
|
|
|
|
fun todo(): Nothing = throw Exception()
|
|
fun bar() {} |