Do not throw an exception when a when-statement with no else makes no match
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fun box(): String {
|
||||
var r = "OK"
|
||||
val x = 3
|
||||
val y: Unit = when (x) {
|
||||
1 -> { r = "Fail 0" }
|
||||
2 -> { r = "Fail 1" }
|
||||
}
|
||||
return r
|
||||
}
|
||||
Reference in New Issue
Block a user