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