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,9 @@
|
||||
// See also: KT-3743
|
||||
fun foo(arg: Boolean?): String {
|
||||
// Must be exhaustive
|
||||
return when(arg) {
|
||||
true -> "truth"
|
||||
false -> "falsehood"
|
||||
null -> "unknown"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user