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

8 lines
148 B
Kotlin
Vendored

fun foo(arg: Boolean): String {
// Must be exhaustive
return when(arg) {
(true) -> "truth"
((false)) -> "falsehood"
}
}