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