Exhaustive when on boolean argument. A set of tests.
Compile-time constants are taken into account. #KT-3743 Fixed.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fun foo(arg: Boolean): String {
|
||||
// Must be exhaustive
|
||||
return when(arg) {
|
||||
(true) -> "truth"
|
||||
((false)) -> "falsehood"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user