Exhaustive when with 'Unit' result now also generates an exception in else branch #KT-12192 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-05-16 18:14:33 +03:00
parent 23a4184e48
commit f35fd32a25
5 changed files with 42 additions and 6 deletions
@@ -0,0 +1,9 @@
fun test(i: Int): String {
when (i) {
0 -> return "0"
1 -> return "1"
}
return "OK"
}
fun box(): String = test(42)