Files
kotlin-fork/compiler/testData/cfg/controlStructures/whenExhaustive.kt
T
Mikhail Glukhikh 0d7f649cc2 Implementation of exhaustive whens in control flow analysis.
Now control flow analyzer knows when is exhaustive.
If despite of this all conditions are accidentally false, jump to error is generated.
A set of tests (diagnostic, control flow). #KT-5113 Fixed. #KT-6046 Fixed. #KT-1882 Fixed.
2015-05-18 19:44:29 +03:00

6 lines
106 B
Kotlin
Vendored

fun foo(flag: Boolean): Int {
when (flag) {
true -> return 1
false -> return 0
}
}