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,15 @@
fun foo(x: Int) {
when {
x == 21 -> foo(x)
x == 42 -> foo(x)
else -> foo(x)
}
val t = when {
x == 21 -> foo(x)
x == 42 -> foo(x)
else -> foo(x)
}
}
// 3 4 5 9 10 11 8
@@ -0,0 +1,15 @@
fun foo(x: Int) {
when (x) {
21 -> foo(x)
42 -> foo(x)
else -> foo(x)
}
val t = when (x) {
21 -> foo(x)
42 -> foo(x)
else -> foo(x)
}
}
// 2 3 4 5 8 9 10 11 8