21dfee4565
TODO: fix inference bug
28 lines
508 B
Kotlin
Vendored
28 lines
508 B
Kotlin
Vendored
fun one() = 1
|
|
fun two() = 2
|
|
|
|
fun test1(): Int {
|
|
while (true) {
|
|
when (one()) {
|
|
1 -> {
|
|
when(two()) {
|
|
2 -> return 2
|
|
}
|
|
} // : Nothing
|
|
else -> return 3
|
|
}
|
|
}
|
|
}
|
|
|
|
fun test2(): Int {
|
|
while (true) {
|
|
when (one()) {
|
|
1 ->
|
|
when (two()) {
|
|
2 -> return 2
|
|
} // : Unit -> Nothing
|
|
else -> return 3
|
|
} // : Nothing
|
|
}
|
|
}
|