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

9 lines
190 B
Kotlin
Vendored

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