Files
kotlin-fork/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt
T
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

10 lines
190 B
Kotlin
Vendored

// See also: KT-3743
fun foo(arg: Boolean?): String {
// Must be exhaustive
return when(arg) {
true -> "truth"
false -> "falsehood"
null -> "unknown"
}
}