Files
kotlin/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt
Mikhail Glukhikh c4aa6d01a9 Exhaustive when on boolean argument. A set of tests.
Compile-time constants are taken into account. #KT-3743 Fixed.
2015-05-18 19:44:22 +03:00

9 lines
166 B
Kotlin
Vendored

// See also: KT-3743
fun foo(arg: Boolean): String {
// Must be exhaustive
return when(arg) {
2 == 2 -> "truth"
2 == 1 -> "falsehood"
}
}