Do not throw an exception when a when-statement with no else makes no match

This commit is contained in:
Andrey Breslav
2013-10-18 18:34:54 +04:00
parent aacf133ef6
commit ea2b6e4546
10 changed files with 111 additions and 2 deletions
@@ -0,0 +1,11 @@
var r = "OK"
fun foo(x: Int) {
return when (x) {
1 -> { r = "Fail" }
}
}
fun box(): String {
foo(0)
return r
}