[JVM_IR]: Improve stepping for when.
Additionally, use the line number of the class for default interface dispatch methods.
This commit is contained in:
+113
@@ -0,0 +1,113 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun stringSwitch(x: String) {
|
||||
val l = when {
|
||||
x == "x" -> 1
|
||||
x == "xy" -> 2
|
||||
x == "xyz" -> 3
|
||||
else -> -1
|
||||
}
|
||||
|
||||
val l2 = when (x) {
|
||||
"x" -> 1
|
||||
"xy" -> 2
|
||||
"xyz" -> 3
|
||||
else -> -1
|
||||
}
|
||||
|
||||
val l3 = when
|
||||
(x)
|
||||
{
|
||||
"x" -> 1
|
||||
"xy" -> 2
|
||||
"xyz" -> 3
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
||||
fun box() {
|
||||
stringSwitch("x")
|
||||
stringSwitch("xy")
|
||||
stringSwitch("xyz")
|
||||
stringSwitch("nope")
|
||||
}
|
||||
|
||||
// JVM_IR uses the line number of the start of the `when` as the line number
|
||||
// for the lookup/table switch. Therefore when the subject and the when is
|
||||
// on separate lines the first step is on the subject, then steop to the when,
|
||||
// then to the right branch.
|
||||
|
||||
// JVM_IR uses optimized lookup/table switches for all these cases. JVM
|
||||
// does not. So on JVM there are steps on each condition evaluation for
|
||||
// the first `when`.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:29 box
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:5 stringSwitch
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:12 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:19 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:18 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:21 stringSwitch
|
||||
// test.kt:18 stringSwitch
|
||||
// test.kt:26 stringSwitch
|
||||
// test.kt:30 box
|
||||
// test.kt:4 stringSwitch
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:6 stringSwitch
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:13 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:19 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:18 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:22 stringSwitch
|
||||
// test.kt:18 stringSwitch
|
||||
// test.kt:26 stringSwitch
|
||||
// test.kt:31 box
|
||||
// test.kt:4 stringSwitch
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 stringSwitch
|
||||
// test.kt:6 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:7 stringSwitch
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:14 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:19 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:18 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:23 stringSwitch
|
||||
// test.kt:18 stringSwitch
|
||||
// test.kt:26 stringSwitch
|
||||
// test.kt:32 box
|
||||
// test.kt:4 stringSwitch
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 stringSwitch
|
||||
// test.kt:6 stringSwitch
|
||||
// test.kt:7 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:8 stringSwitch
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:15 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:19 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:18 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:24 stringSwitch
|
||||
// test.kt:18 stringSwitch
|
||||
// test.kt:26 stringSwitch
|
||||
// test.kt:33 box
|
||||
@@ -0,0 +1,96 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun stringSwitch(x: String) {
|
||||
val l = when {
|
||||
x == "x" -> 1
|
||||
x == "xy" -> 2
|
||||
else -> -1
|
||||
}
|
||||
|
||||
val l2 = when (x) {
|
||||
"x" -> 1
|
||||
"xy" -> 2
|
||||
else -> -1
|
||||
}
|
||||
|
||||
val l3 = when
|
||||
(x)
|
||||
{
|
||||
"x" -> 1
|
||||
"xy" -> 2
|
||||
else -> -1
|
||||
}
|
||||
}
|
||||
|
||||
fun box() {
|
||||
stringSwitch("x")
|
||||
stringSwitch("xy")
|
||||
stringSwitch("nope")
|
||||
}
|
||||
|
||||
// JVM_IR uses the line number of the start of the `when` as the line number
|
||||
// for the lookup/table switch. Therefore when the subject and the when is
|
||||
// on separate lines the first step is on the subject, then steop to the when,
|
||||
// then to the right branch.
|
||||
|
||||
// JVM_IR uses unoptimized lookup/table switches for all these cases. JVM
|
||||
// does not. So on JVM there are direct jumps to the right branch for the
|
||||
// last two whens.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:26 box
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:5 stringSwitch
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:10 stringSwitch
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:10 stringSwitch
|
||||
// test.kt:17 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:16 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:19 stringSwitch
|
||||
// test.kt:16 stringSwitch
|
||||
// test.kt:23 stringSwitch
|
||||
// test.kt:27 box
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:5 stringSwitch
|
||||
// test.kt:6 stringSwitch
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:10 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:11 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:12 stringSwitch
|
||||
// test.kt:10 stringSwitch
|
||||
// test.kt:17 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:16 stringSwitch
|
||||
// test.kt:19 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:20 stringSwitch
|
||||
// test.kt:16 stringSwitch
|
||||
// test.kt:23 stringSwitch
|
||||
// test.kt:28 box
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:5 stringSwitch
|
||||
// test.kt:6 stringSwitch
|
||||
// test.kt:7 stringSwitch
|
||||
// test.kt:4 stringSwitch
|
||||
// test.kt:10 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:11 stringSwitch
|
||||
// test.kt:12 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:13 stringSwitch
|
||||
// test.kt:10 stringSwitch
|
||||
// test.kt:17 stringSwitch
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:16 stringSwitch
|
||||
// test.kt:19 stringSwitch
|
||||
// test.kt:20 stringSwitch
|
||||
// LINENUMBERS
|
||||
// test.kt:21 stringSwitch
|
||||
// test.kt:16 stringSwitch
|
||||
// test.kt:23 stringSwitch
|
||||
// test.kt:29 box
|
||||
+26
-22
@@ -8,34 +8,38 @@ interface A {
|
||||
}
|
||||
}
|
||||
|
||||
class B : A
|
||||
|
||||
fun box() {
|
||||
(object : A {}).bar()
|
||||
B().bar()
|
||||
}
|
||||
|
||||
// The JVM backend generates non-synthetic overrides of foo and bar
|
||||
// in the object both with line number 12. That means that there will
|
||||
// be steps on line number 12 on entry and exit to both bar and foo.
|
||||
|
||||
// TODO: Is this what we want? Should they be marked as bridges instead?
|
||||
// Doesn't look like the intellij debugger skips non-synthetic bridges?
|
||||
// There seems to be some heuristics in intellij dealing with this as
|
||||
// the stepping behavior with repeated step-into is mostly OK.
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// The JVM_IR backend generates non-synthetic overrides of foo and bar
|
||||
// with no line numbers. That leads to steps on line -1 but only on
|
||||
// exit from bar and foo.
|
||||
// The dispatch methods added to classes directly implementing
|
||||
// interfaces with default methods (forwarding to the actual implementation
|
||||
// on A$DefaultImpls) have the line number of the class declaration.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:12 box
|
||||
// test.kt:12 <init>
|
||||
// test.kt:12 box
|
||||
// test.kt:12 bar
|
||||
// test.kt:14 box
|
||||
// test.kt:14 <init>
|
||||
// test.kt:14 box
|
||||
// test.kt:14 bar
|
||||
// test.kt:7 bar
|
||||
// test.kt:12 foo
|
||||
// test.kt:14 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:14 foo
|
||||
// test.kt:7 bar
|
||||
// test.kt:12 bar
|
||||
// test.kt:12 box
|
||||
// test.kt:13 box
|
||||
// test.kt:14 bar
|
||||
// test.kt:14 box
|
||||
// test.kt:15 box
|
||||
// test.kt:11 <init>
|
||||
// test.kt:15 box
|
||||
// test.kt:11 bar
|
||||
// test.kt:7 bar
|
||||
// test.kt:11 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:7 bar
|
||||
// test.kt:11 bar
|
||||
// test.kt:15 box
|
||||
// test.kt:16 box
|
||||
+29
-7
@@ -18,41 +18,51 @@ fun box() {
|
||||
foo(21)
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
// The JVM_IR backend has line number 8 when leaving the first
|
||||
// when. Also, the stepping is different, probably because the when
|
||||
// is compiled to a switch which it isn't with JVM? The stepping
|
||||
// behavior is likely OK, but should be double checked.
|
||||
// JVM_IR backend optimized the when to a switch in the java bytecode.
|
||||
// Therefore, the stepping for JVM_IR does not step through the evaluation
|
||||
// of each of the conditions, but goes directly to the right body. The
|
||||
// JVM_IR stepping behavior here is the same as for `whenSubject.kt`.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:18 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:10 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:11 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
@@ -63,29 +73,41 @@ fun box() {
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:10 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:11 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
@@ -95,4 +117,4 @@ fun box() {
|
||||
// test.kt:11 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:19 box
|
||||
// test.kt:19 box
|
||||
@@ -0,0 +1,49 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(x: Int) {
|
||||
when (val y =
|
||||
when {
|
||||
x == 0 -> 1
|
||||
x == 1 -> 2
|
||||
else -> 0
|
||||
}) {
|
||||
0 -> 3
|
||||
1 -> 4
|
||||
}
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo(0)
|
||||
foo(1)
|
||||
foo(2)
|
||||
}
|
||||
|
||||
// The JVM_IR backend optimizes the inner when to a switch and therefore goes directly to the
|
||||
// right case without stepping through evaluation of each condition.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:16 box
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:17 box
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:7 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:18 box
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:6 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:8 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:19 box
|
||||
@@ -0,0 +1,83 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(x: Int): Int {
|
||||
when {
|
||||
x == 21 ->
|
||||
1
|
||||
x == 42 ->
|
||||
2
|
||||
else ->
|
||||
3
|
||||
}
|
||||
|
||||
val t = when {
|
||||
x == 21 ->
|
||||
1
|
||||
x == 42 ->
|
||||
2
|
||||
else ->
|
||||
3
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo(21)
|
||||
foo(42)
|
||||
foo(63)
|
||||
}
|
||||
|
||||
// JVM_IR backend optimized the when to a switch in the java bytecode.
|
||||
// Therefore, the stepping for JVM_IR does not step through the evaluation
|
||||
// of each of the conditions, but goes directly to the right body.
|
||||
// JVM_IR stepping behavior here is the same as for `whenMultiLineSubject.kt`.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:26 box
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:6 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:14 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:15 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:22 foo
|
||||
// test.kt:26 box
|
||||
// test.kt:27 box
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:8 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:14 foo
|
||||
// test.kt:16 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:17 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:22 foo
|
||||
// test.kt:27 box
|
||||
// test.kt:28 box
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:5 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM
|
||||
// test.kt:14 foo
|
||||
// test.kt:16 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:19 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:22 foo
|
||||
// test.kt:28 box
|
||||
// test.kt:29 box
|
||||
@@ -0,0 +1,56 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(x: Int): Int {
|
||||
when (x) {
|
||||
21 ->
|
||||
1
|
||||
42 ->
|
||||
2
|
||||
else ->
|
||||
3
|
||||
}
|
||||
|
||||
val t = when (x) {
|
||||
21 ->
|
||||
1
|
||||
42 ->
|
||||
2
|
||||
else ->
|
||||
3
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo(21)
|
||||
foo(42)
|
||||
foo(63)
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:26 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:22 foo
|
||||
// test.kt:26 box
|
||||
// test.kt:27 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:8 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:17 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:22 foo
|
||||
// test.kt:27 box
|
||||
// test.kt:28 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:22 foo
|
||||
// test.kt:28 box
|
||||
// test.kt:29 box
|
||||
-23
@@ -18,8 +18,6 @@ fun box() {
|
||||
foo(21)
|
||||
}
|
||||
|
||||
// JVM_IR stops on line 8 when exiting the first when.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:18 box
|
||||
// test.kt:4 foo
|
||||
@@ -28,24 +26,15 @@ fun box() {
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
@@ -54,33 +43,21 @@ fun box() {
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(x: Int) {
|
||||
when
|
||||
(x)
|
||||
{
|
||||
21 -> foo(42)
|
||||
42 -> foo(63)
|
||||
else -> 1
|
||||
}
|
||||
|
||||
val t = when
|
||||
(x)
|
||||
{
|
||||
21 -> foo(42)
|
||||
42 -> foo(63)
|
||||
else -> 2
|
||||
}
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo(21)
|
||||
}
|
||||
|
||||
// JVM_IR uses the line number of the when for the table switch and therefore,
|
||||
// it stops on the subject line first, then on the when line (line 4 and 12), and
|
||||
// then goes to the right branch.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:22 box
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:7 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:8 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:9 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:17 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:8 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:16 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:9 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:17 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:16 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:15 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:8 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:9 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:17 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:8 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:16 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:4 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:9 foo
|
||||
// test.kt:13 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:12 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:17 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:16 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:23 box
|
||||
Reference in New Issue
Block a user