When-statements & correct line numbers

This commit is contained in:
Alexander Udalov
2012-11-22 18:51:30 +04:00
parent aa898725fc
commit 9d3907ff98
8 changed files with 76 additions and 1 deletions
@@ -0,0 +1,9 @@
fun z() {}
fun foo(x: Int) {
when {
x == 21 -> z()
x == 42 -> z()
else -> {}
}
}
@@ -0,0 +1,9 @@
fun z() {}
fun foo(x: Int) {
when (x) {
21 -> z()
42 -> z()
else -> {}
}
}