diff --git a/compiler/testData/cfg/controlStructures/Finally.instructions b/compiler/testData/cfg/controlStructures/Finally.instructions index 4fde7c0b147..082f942716b 100644 --- a/compiler/testData/cfg/controlStructures/Finally.instructions +++ b/compiler/testData/cfg/controlStructures/Finally.instructions @@ -89,7 +89,7 @@ sink: fun t3() { try { 1 - @l{ () -> + l@{ () -> if (2 > 3) { return@l } @@ -101,12 +101,12 @@ fun t3() { --------------------- L0: 1 - 2 mark({ try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } }) - mark(try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 }) - jmp?(L2) NEXT:[mark({ 2 }), mark({ 1 @l{ () -> if (2 > 3) { return@l } } })] - 3 mark({ 1 @l{ () -> if (2 > 3) { return@l } } }) + 2 mark({ try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 } }) + mark(try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 }) + jmp?(L2) NEXT:[mark({ 2 }), mark({ 1 l@{ () -> if (2 > 3) { return@l } } })] + 3 mark({ 1 l@{ () -> if (2 > 3) { return@l } } }) r(1) -> - mark(@l{ () -> if (2 > 3) { return@l } }) + mark(l@{ () -> if (2 > 3) { return@l } }) mark({ () -> if (2 > 3) { return@l } }) jmp?(L3) NEXT:[r({ () -> if (2 > 3) { return@l } }) -> , d({ () -> if (2 > 3) { return@l } })] d({ () -> if (2 > 3) { return@l } }) NEXT:[] @@ -123,7 +123,7 @@ L8 [skipFinallyToErrorBlock]: L11 [copy of L2, onExceptionToFinallyBlock]: 3 mark({ 2 }) PREV:[jmp(L8)] r(2) -> - 2 merge(try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 }|) -> + 2 merge(try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 }|) -> L1: 1 NEXT:[] error: @@ -163,7 +163,7 @@ sink: ===================== == t4 == fun t4() { - @l{ () -> + l@{ () -> try { 1 if (2 > 3) { @@ -177,8 +177,8 @@ fun t4() { --------------------- L0: 1 - 2 mark({ @l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } }) - mark(@l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) + 2 mark({ l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } }) + mark(l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) mark({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) jmp?(L2) NEXT:[r({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> , d({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } })] d({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) NEXT:[] @@ -245,11 +245,11 @@ sink: ===================== == t5 == fun t5() { - @l while(true) { + l@ while(true) { try { 1 if (2 > 3) { - break @l + break@l } } finally { 2 @@ -259,63 +259,63 @@ fun t5() { --------------------- L0: 1 - 2 mark({ @l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } } }) - mark(@l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } }) + 2 mark({ l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } }) + mark(l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } }) L2 [loop entry point]: L6 [condition entry point]: - r(true) -> PREV:[mark(@l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } }), jmp(L2)] - mark(while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } }) + r(true) -> PREV:[mark(l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } }), jmp(L2)] + mark(while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } }) magic[VALUE_CONSUMER](true|) -> L4 [body entry point]: - 3 mark({ try { 1 if (2 > 3) { break @l } } finally { 2 } }) - mark(try { 1 if (2 > 3) { break @l } } finally { 2 }) - jmp?(L7) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { break @l } })] - 4 mark({ 1 if (2 > 3) { break @l } }) + 3 mark({ try { 1 if (2 > 3) { break@l } } finally { 2 } }) + mark(try { 1 if (2 > 3) { break@l } } finally { 2 }) + jmp?(L7) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { break@l } })] + 4 mark({ 1 if (2 > 3) { break@l } }) r(1) -> - mark(if (2 > 3) { break @l }) + mark(if (2 > 3) { break@l }) r(2) -> r(3) -> mark(2 > 3) call(2 > 3, compareTo|, ) -> - jf(L8|) NEXT:[read (Unit), mark({ break @l })] - 5 mark({ break @l }) + jf(L8|) NEXT:[read (Unit), mark({ break@l })] + 5 mark({ break@l }) L9 [start finally]: 6 mark({ 2 }) r(2) -> L10 [finish finally]: - 5 jmp(L3) NEXT:[read (Unit)] -- 4 jmp(L11) NEXT:[merge(if (2 > 3) { break @l }|!) -> ] PREV:[] + 5 jmp(L3) NEXT:[read (Unit)] +- 4 jmp(L11) NEXT:[merge(if (2 > 3) { break@l }|!) -> ] PREV:[] L8 [else branch]: - read (Unit) PREV:[jf(L8|)] + read (Unit) PREV:[jf(L8|)] L11 ['if' expression result]: - merge(if (2 > 3) { break @l }|!) -> - 3 jmp(L12) NEXT:[mark({ 2 })] + merge(if (2 > 3) { break@l }|!) -> + 3 jmp(L12) NEXT:[mark({ 2 })] L7 [onExceptionToFinallyBlock]: - 6 mark({ 2 }) PREV:[jmp?(L7)] + 6 mark({ 2 }) PREV:[jmp?(L7)] r(2) -> - 3 jmp(error) NEXT:[] + 3 jmp(error) NEXT:[] L12 [skipFinallyToErrorBlock]: - 6 mark({ 2 }) PREV:[jmp(L12)] + 6 mark({ 2 }) PREV:[jmp(L12)] r(2) -> - 3 merge(try { 1 if (2 > 3) { break @l } } finally { 2 }|) -> - 2 jmp(L2) NEXT:[r(true) -> ] + 3 merge(try { 1 if (2 > 3) { break@l } } finally { 2 }|) -> + 2 jmp(L2) NEXT:[r(true) -> ] L3 [loop exit point]: L5 [body exit point]: - read (Unit) PREV:[jmp(L3)] + read (Unit) PREV:[jmp(L3)] L1: - 1 NEXT:[] + 1 NEXT:[] error: - PREV:[jmp(error)] + PREV:[jmp(error)] sink: - PREV:[, ] + PREV:[, ] ===================== == t6 == fun t6() { try { - @l while(true) { + l@ while(true) { 1 if (2 > 3) { - break @l + break@l } } 5 @@ -326,114 +326,49 @@ fun t6() { --------------------- L0: 1 - 2 mark({ try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 } }) - mark(try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 }) - jmp?(L2) NEXT:[mark({ 2 }), mark({ @l while(true) { 1 if (2 > 3) { break @l } } 5 })] - 3 mark({ @l while(true) { 1 if (2 > 3) { break @l } } 5 }) - mark(@l while(true) { 1 if (2 > 3) { break @l } }) + 2 mark({ try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 } }) + mark(try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 }) + jmp?(L2) NEXT:[mark({ 2 }), mark({ l@ while(true) { 1 if (2 > 3) { break@l } } 5 })] + 3 mark({ l@ while(true) { 1 if (2 > 3) { break@l } } 5 }) + mark(l@ while(true) { 1 if (2 > 3) { break@l } }) L3 [loop entry point]: L7 [condition entry point]: - r(true) -> PREV:[mark(@l while(true) { 1 if (2 > 3) { break @l } }), jmp(L3)] - mark(while(true) { 1 if (2 > 3) { break @l } }) + r(true) -> PREV:[mark(l@ while(true) { 1 if (2 > 3) { break@l } }), jmp(L3)] + mark(while(true) { 1 if (2 > 3) { break@l } }) magic[VALUE_CONSUMER](true|) -> L5 [body entry point]: - 4 mark({ 1 if (2 > 3) { break @l } }) + 4 mark({ 1 if (2 > 3) { break@l } }) r(1) -> - mark(if (2 > 3) { break @l }) + mark(if (2 > 3) { break@l }) r(2) -> r(3) -> mark(2 > 3) call(2 > 3, compareTo|, ) -> - jf(L8|) NEXT:[read (Unit), mark({ break @l })] - 5 mark({ break @l }) - jmp(L4) NEXT:[read (Unit)] -- 4 jmp(L9) NEXT:[merge(if (2 > 3) { break @l }|!) -> ] PREV:[] -L8 [else branch]: - read (Unit) PREV:[jf(L8|)] -L9 ['if' expression result]: - merge(if (2 > 3) { break @l }|!) -> - 3 jmp(L3) NEXT:[r(true) -> ] -L4 [loop exit point]: -L6 [body exit point]: - read (Unit) PREV:[jmp(L4)] - r(5) -> - 2 jmp(L10) NEXT:[mark({ 2 })] -L2 [onExceptionToFinallyBlock]: -L11 [start finally]: - 3 mark({ 2 }) PREV:[jmp?(L2)] - r(2) -> -L12 [finish finally]: - 2 jmp(error) NEXT:[] -L10 [skipFinallyToErrorBlock]: -L13 [copy of L2, onExceptionToFinallyBlock]: - 3 mark({ 2 }) PREV:[jmp(L10)] - r(2) -> - 2 merge(try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 }|) -> -L1: - 1 NEXT:[] -error: - PREV:[jmp(error)] -sink: - PREV:[, ] -===================== -== t7 == -fun t7() { - try { - @l while(true) { - 1 - if (2 > 3) { - break @l - } - } - } finally { - 2 - } -} ---------------------- -L0: - 1 - 2 mark({ try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 } }) - mark(try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 }) - jmp?(L2) NEXT:[mark({ 2 }), mark({ @l while(true) { 1 if (2 > 3) { break @l } } })] - 3 mark({ @l while(true) { 1 if (2 > 3) { break @l } } }) - mark(@l while(true) { 1 if (2 > 3) { break @l } }) -L3 [loop entry point]: -L7 [condition entry point]: - r(true) -> PREV:[mark(@l while(true) { 1 if (2 > 3) { break @l } }), jmp(L3)] - mark(while(true) { 1 if (2 > 3) { break @l } }) - magic[VALUE_CONSUMER](true|) -> -L5 [body entry point]: - 4 mark({ 1 if (2 > 3) { break @l } }) - r(1) -> - mark(if (2 > 3) { break @l }) - r(2) -> - r(3) -> - mark(2 > 3) - call(2 > 3, compareTo|, ) -> - jf(L8|) NEXT:[read (Unit), mark({ break @l })] - 5 mark({ break @l }) + jf(L8|) NEXT:[read (Unit), mark({ break@l })] + 5 mark({ break@l }) jmp(L4) NEXT:[read (Unit)] -- 4 jmp(L9) NEXT:[merge(if (2 > 3) { break @l }|!) -> ] PREV:[] +- 4 jmp(L9) NEXT:[merge(if (2 > 3) { break@l }|!) -> ] PREV:[] L8 [else branch]: read (Unit) PREV:[jf(L8|)] L9 ['if' expression result]: - merge(if (2 > 3) { break @l }|!) -> + merge(if (2 > 3) { break@l }|!) -> 3 jmp(L3) NEXT:[r(true) -> ] L4 [loop exit point]: L6 [body exit point]: read (Unit) PREV:[jmp(L4)] + r(5) -> 2 jmp(L10) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L11 [start finally]: 3 mark({ 2 }) PREV:[jmp?(L2)] - r(2) -> + r(2) -> L12 [finish finally]: 2 jmp(error) NEXT:[] L10 [skipFinallyToErrorBlock]: L13 [copy of L2, onExceptionToFinallyBlock]: 3 mark({ 2 }) PREV:[jmp(L10)] - r(2) -> - 2 merge(try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 }|!) -> + r(2) -> + 2 merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 }|) -> L1: 1 NEXT:[] error: @@ -441,13 +376,78 @@ error: sink: PREV:[, ] ===================== +== t7 == +fun t7() { + try { + l@ while(true) { + 1 + if (2 > 3) { + break@l + } + } + } finally { + 2 + } +} +--------------------- +L0: + 1 + 2 mark({ try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 } }) + mark(try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 }) + jmp?(L2) NEXT:[mark({ 2 }), mark({ l@ while(true) { 1 if (2 > 3) { break@l } } })] + 3 mark({ l@ while(true) { 1 if (2 > 3) { break@l } } }) + mark(l@ while(true) { 1 if (2 > 3) { break@l } }) +L3 [loop entry point]: +L7 [condition entry point]: + r(true) -> PREV:[mark(l@ while(true) { 1 if (2 > 3) { break@l } }), jmp(L3)] + mark(while(true) { 1 if (2 > 3) { break@l } }) + magic[VALUE_CONSUMER](true|) -> +L5 [body entry point]: + 4 mark({ 1 if (2 > 3) { break@l } }) + r(1) -> + mark(if (2 > 3) { break@l }) + r(2) -> + r(3) -> + mark(2 > 3) + call(2 > 3, compareTo|, ) -> + jf(L8|) NEXT:[read (Unit), mark({ break@l })] + 5 mark({ break@l }) + jmp(L4) NEXT:[read (Unit)] +- 4 jmp(L9) NEXT:[merge(if (2 > 3) { break@l }|!) -> ] PREV:[] +L8 [else branch]: + read (Unit) PREV:[jf(L8|)] +L9 ['if' expression result]: + merge(if (2 > 3) { break@l }|!) -> + 3 jmp(L3) NEXT:[r(true) -> ] +L4 [loop exit point]: +L6 [body exit point]: + read (Unit) PREV:[jmp(L4)] + 2 jmp(L10) NEXT:[mark({ 2 })] +L2 [onExceptionToFinallyBlock]: +L11 [start finally]: + 3 mark({ 2 }) PREV:[jmp?(L2)] + r(2) -> +L12 [finish finally]: + 2 jmp(error) NEXT:[] +L10 [skipFinallyToErrorBlock]: +L13 [copy of L2, onExceptionToFinallyBlock]: + 3 mark({ 2 }) PREV:[jmp(L10)] + r(2) -> + 2 merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 }|!) -> +L1: + 1 NEXT:[] +error: + PREV:[jmp(error)] +sink: + PREV:[, ] +===================== == t8 == fun t8(a : Int) { - @l for (i in 1..a) { + l@ for (i in 1..a) { try { 1 if (2 > 3) { - continue @l + continue@l } } finally { 2 @@ -460,8 +460,8 @@ L0: v(a : Int) magic[FAKE_INITIALIZER](a : Int) -> w(a|) - 2 mark({ @l for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } } }) - mark(@l for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } }) + 2 mark({ l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } }) + mark(l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } }) 3 r(1) -> r(a) -> mark(1..a) @@ -469,60 +469,60 @@ L0: v(i) L2 [loop entry point]: L6 [condition entry point]: - jmp?(L3) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|) -> ] PREV:[v(i), jmp(L6), jmp(L2)] + jmp?(L3) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|) -> ] PREV:[v(i), jmp(L6), jmp(L2)] magic[LOOP_RANGE_ITERATION](1..a|) -> w(i|) - mark(for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } }) + mark(for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } }) L4 [body entry point]: - 4 mark({ try { 1 if (2 > 3) { continue @l } } finally { 2 } }) - mark(try { 1 if (2 > 3) { continue @l } } finally { 2 }) - jmp?(L7) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { continue @l } })] - 5 mark({ 1 if (2 > 3) { continue @l } }) + 4 mark({ try { 1 if (2 > 3) { continue@l } } finally { 2 } }) + mark(try { 1 if (2 > 3) { continue@l } } finally { 2 }) + jmp?(L7) NEXT:[mark({ 2 }), mark({ 1 if (2 > 3) { continue@l } })] + 5 mark({ 1 if (2 > 3) { continue@l } }) r(1) -> - mark(if (2 > 3) { continue @l }) + mark(if (2 > 3) { continue@l }) r(2) -> r(3) -> mark(2 > 3) call(2 > 3, compareTo|, ) -> - jf(L8|) NEXT:[read (Unit), mark({ continue @l })] - 6 mark({ continue @l }) + jf(L8|) NEXT:[read (Unit), mark({ continue@l })] + 6 mark({ continue@l }) L9 [start finally]: 7 mark({ 2 }) r(2) -> L10 [finish finally]: - 6 jmp(L6) NEXT:[jmp?(L3)] -- 5 jmp(L11) NEXT:[merge(if (2 > 3) { continue @l }|!) -> ] PREV:[] + 6 jmp(L6) NEXT:[jmp?(L3)] +- 5 jmp(L11) NEXT:[merge(if (2 > 3) { continue@l }|!) -> ] PREV:[] L8 [else branch]: - read (Unit) PREV:[jf(L8|)] + read (Unit) PREV:[jf(L8|)] L11 ['if' expression result]: - merge(if (2 > 3) { continue @l }|!) -> - 4 jmp(L12) NEXT:[mark({ 2 })] + merge(if (2 > 3) { continue@l }|!) -> + 4 jmp(L12) NEXT:[mark({ 2 })] L7 [onExceptionToFinallyBlock]: - 7 mark({ 2 }) PREV:[jmp?(L7)] + 7 mark({ 2 }) PREV:[jmp?(L7)] r(2) -> - 4 jmp(error) NEXT:[] + 4 jmp(error) NEXT:[] L12 [skipFinallyToErrorBlock]: - 7 mark({ 2 }) PREV:[jmp(L12)] + 7 mark({ 2 }) PREV:[jmp(L12)] r(2) -> - 4 merge(try { 1 if (2 > 3) { continue @l } } finally { 2 }|) -> - 3 jmp(L2) NEXT:[jmp?(L3)] + 4 merge(try { 1 if (2 > 3) { continue@l } } finally { 2 }|) -> + 3 jmp(L2) NEXT:[jmp?(L3)] L3 [loop exit point]: L5 [body exit point]: - read (Unit) PREV:[jmp?(L3)] + read (Unit) PREV:[jmp?(L3)] L1: - 1 NEXT:[] + 1 NEXT:[] error: - PREV:[jmp(error)] + PREV:[jmp(error)] sink: - PREV:[, ] + PREV:[, ] ===================== == t9 == fun t9(a : Int) { try { - @l for (i in 1..a) { + l@ for (i in 1..a) { 1 if (2 > 3) { - continue @l + continue@l } } 5 @@ -536,86 +536,11 @@ L0: v(a : Int) magic[FAKE_INITIALIZER](a : Int) -> w(a|) - 2 mark({ try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 } }) - mark(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 }) - jmp?(L2) NEXT:[mark({ 2 }), mark({ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 })] - 3 mark({ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 }) - mark(@l for (i in 1..a) { 1 if (2 > 3) { continue @l } }) - 4 r(1) -> - r(a) -> - mark(1..a) - call(1..a, rangeTo|, ) -> - v(i) -L3 [loop entry point]: -L7 [condition entry point]: - jmp?(L4) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|) -> ] PREV:[v(i), jmp(L7), jmp(L3)] - magic[LOOP_RANGE_ITERATION](1..a|) -> - w(i|) - mark(for (i in 1..a) { 1 if (2 > 3) { continue @l } }) -L5 [body entry point]: - 5 mark({ 1 if (2 > 3) { continue @l } }) - r(1) -> - mark(if (2 > 3) { continue @l }) - r(2) -> - r(3) -> - mark(2 > 3) - call(2 > 3, compareTo|, ) -> - jf(L8|) NEXT:[read (Unit), mark({ continue @l })] - 6 mark({ continue @l }) - jmp(L7) NEXT:[jmp?(L4)] -- 5 jmp(L9) NEXT:[merge(if (2 > 3) { continue @l }|!) -> ] PREV:[] -L8 [else branch]: - read (Unit) PREV:[jf(L8|)] -L9 ['if' expression result]: - merge(if (2 > 3) { continue @l }|!) -> - 4 jmp(L3) NEXT:[jmp?(L4)] -L4 [loop exit point]: -L6 [body exit point]: - read (Unit) PREV:[jmp?(L4)] - 3 r(5) -> - 2 jmp(L10) NEXT:[mark({ 2 })] -L2 [onExceptionToFinallyBlock]: -L11 [start finally]: - 3 mark({ 2 }) PREV:[jmp?(L2)] - r(2) -> -L12 [finish finally]: - 2 jmp(error) NEXT:[] -L10 [skipFinallyToErrorBlock]: -L13 [copy of L2, onExceptionToFinallyBlock]: - 3 mark({ 2 }) PREV:[jmp(L10)] - r(2) -> - 2 merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 }|) -> -L1: - 1 NEXT:[] -error: - PREV:[jmp(error)] -sink: - PREV:[, ] -===================== -== t10 == -fun t10(a : Int) { - try { - @l for (i in 1..a) { - 1 - if (2 > 3) { - continue @l - } - } - } finally { - 2 - } -} ---------------------- -L0: - 1 - v(a : Int) - magic[FAKE_INITIALIZER](a : Int) -> - w(a|) - 2 mark({ try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 } }) - mark(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 }) - jmp?(L2) NEXT:[mark({ 2 }), mark({ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } })] - 3 mark({ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } }) - mark(@l for (i in 1..a) { 1 if (2 > 3) { continue @l } }) + 2 mark({ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 } }) + mark(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 }) + jmp?(L2) NEXT:[mark({ 2 }), mark({ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 })] + 3 mark({ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 }) + mark(l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } }) 4 r(1) -> r(a) -> mark(1..a) @@ -626,39 +551,40 @@ L7 [condition entry point]: jmp?(L4) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|) -> ] PREV:[v(i), jmp(L7), jmp(L3)] magic[LOOP_RANGE_ITERATION](1..a|) -> w(i|) - mark(for (i in 1..a) { 1 if (2 > 3) { continue @l } }) + mark(for (i in 1..a) { 1 if (2 > 3) { continue@l } }) L5 [body entry point]: - 5 mark({ 1 if (2 > 3) { continue @l } }) + 5 mark({ 1 if (2 > 3) { continue@l } }) r(1) -> - mark(if (2 > 3) { continue @l }) + mark(if (2 > 3) { continue@l }) r(2) -> r(3) -> mark(2 > 3) call(2 > 3, compareTo|, ) -> - jf(L8|) NEXT:[read (Unit), mark({ continue @l })] - 6 mark({ continue @l }) + jf(L8|) NEXT:[read (Unit), mark({ continue@l })] + 6 mark({ continue@l }) jmp(L7) NEXT:[jmp?(L4)] -- 5 jmp(L9) NEXT:[merge(if (2 > 3) { continue @l }|!) -> ] PREV:[] +- 5 jmp(L9) NEXT:[merge(if (2 > 3) { continue@l }|!) -> ] PREV:[] L8 [else branch]: read (Unit) PREV:[jf(L8|)] L9 ['if' expression result]: - merge(if (2 > 3) { continue @l }|!) -> + merge(if (2 > 3) { continue@l }|!) -> 4 jmp(L3) NEXT:[jmp?(L4)] L4 [loop exit point]: L6 [body exit point]: read (Unit) PREV:[jmp?(L4)] + 3 r(5) -> 2 jmp(L10) NEXT:[mark({ 2 })] L2 [onExceptionToFinallyBlock]: L11 [start finally]: 3 mark({ 2 }) PREV:[jmp?(L2)] - r(2) -> + r(2) -> L12 [finish finally]: 2 jmp(error) NEXT:[] L10 [skipFinallyToErrorBlock]: L13 [copy of L2, onExceptionToFinallyBlock]: 3 mark({ 2 }) PREV:[jmp(L10)] - r(2) -> - 2 merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 }|!) -> + r(2) -> + 2 merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 }|) -> L1: 1 NEXT:[] error: @@ -666,6 +592,80 @@ error: sink: PREV:[, ] ===================== +== t10 == +fun t10(a : Int) { + try { + l@ for (i in 1..a) { + 1 + if (2 > 3) { + continue@l + } + } + } finally { + 2 + } +} +--------------------- +L0: + 1 + v(a : Int) + magic[FAKE_INITIALIZER](a : Int) -> + w(a|) + 2 mark({ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 } }) + mark(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 }) + jmp?(L2) NEXT:[mark({ 2 }), mark({ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } })] + 3 mark({ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } }) + mark(l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } }) + 4 r(1) -> + r(a) -> + mark(1..a) + call(1..a, rangeTo|, ) -> + v(i) +L3 [loop entry point]: +L7 [condition entry point]: + jmp?(L4) NEXT:[read (Unit), magic[LOOP_RANGE_ITERATION](1..a|) -> ] PREV:[v(i), jmp(L7), jmp(L3)] + magic[LOOP_RANGE_ITERATION](1..a|) -> + w(i|) + mark(for (i in 1..a) { 1 if (2 > 3) { continue@l } }) +L5 [body entry point]: + 5 mark({ 1 if (2 > 3) { continue@l } }) + r(1) -> + mark(if (2 > 3) { continue@l }) + r(2) -> + r(3) -> + mark(2 > 3) + call(2 > 3, compareTo|, ) -> + jf(L8|) NEXT:[read (Unit), mark({ continue@l })] + 6 mark({ continue@l }) + jmp(L7) NEXT:[jmp?(L4)] +- 5 jmp(L9) NEXT:[merge(if (2 > 3) { continue@l }|!) -> ] PREV:[] +L8 [else branch]: + read (Unit) PREV:[jf(L8|)] +L9 ['if' expression result]: + merge(if (2 > 3) { continue@l }|!) -> + 4 jmp(L3) NEXT:[jmp?(L4)] +L4 [loop exit point]: +L6 [body exit point]: + read (Unit) PREV:[jmp?(L4)] + 2 jmp(L10) NEXT:[mark({ 2 })] +L2 [onExceptionToFinallyBlock]: +L11 [start finally]: + 3 mark({ 2 }) PREV:[jmp?(L2)] + r(2) -> +L12 [finish finally]: + 2 jmp(error) NEXT:[] +L10 [skipFinallyToErrorBlock]: +L13 [copy of L2, onExceptionToFinallyBlock]: + 3 mark({ 2 }) PREV:[jmp(L10)] + r(2) -> + 2 merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 }|!) -> +L1: + 1 NEXT:[] +error: + PREV:[jmp(error)] +sink: + PREV:[, ] +===================== == t11 == fun t11() { try { diff --git a/compiler/testData/cfg/controlStructures/Finally.kt b/compiler/testData/cfg/controlStructures/Finally.kt index f9e9f42cf6b..7f2ea4526ce 100644 --- a/compiler/testData/cfg/controlStructures/Finally.kt +++ b/compiler/testData/cfg/controlStructures/Finally.kt @@ -20,7 +20,7 @@ fun t2() { fun t3() { try { 1 - @l{ () -> + l@{ () -> if (2 > 3) { return@l } @@ -31,7 +31,7 @@ fun t3() { } fun t4() { - @l{ () -> + l@{ () -> try { 1 if (2 > 3) { @@ -44,11 +44,11 @@ fun t4() { } fun t5() { - @l while(true) { + l@ while(true) { try { 1 if (2 > 3) { - break @l + break@l } } finally { 2 @@ -58,10 +58,10 @@ fun t5() { fun t6() { try { - @l while(true) { + l@ while(true) { 1 if (2 > 3) { - break @l + break@l } } 5 @@ -72,10 +72,10 @@ fun t6() { fun t7() { try { - @l while(true) { + l@ while(true) { 1 if (2 > 3) { - break @l + break@l } } } finally { @@ -84,11 +84,11 @@ fun t7() { } fun t8(a : Int) { - @l for (i in 1..a) { + l@ for (i in 1..a) { try { 1 if (2 > 3) { - continue @l + continue@l } } finally { 2 @@ -98,10 +98,10 @@ fun t8(a : Int) { fun t9(a : Int) { try { - @l for (i in 1..a) { + l@ for (i in 1..a) { 1 if (2 > 3) { - continue @l + continue@l } } 5 @@ -112,10 +112,10 @@ fun t9(a : Int) { fun t10(a : Int) { try { - @l for (i in 1..a) { + l@ for (i in 1..a) { 1 if (2 > 3) { - continue @l + continue@l } } } finally { diff --git a/compiler/testData/cfg/controlStructures/Finally.values b/compiler/testData/cfg/controlStructures/Finally.values index cf07ef29545..32c1f616e23 100644 --- a/compiler/testData/cfg/controlStructures/Finally.values +++ b/compiler/testData/cfg/controlStructures/Finally.values @@ -43,7 +43,7 @@ try { 1 if (2 > 3) { return } } finally { 2 } : * fun t3() { try { 1 - @l{ () -> + l@{ () -> if (2 > 3) { return@l } @@ -55,12 +55,12 @@ fun t3() { --------------------- 1 : * NEW: r(1) -> { () -> if (2 > 3) { return@l } } : * NEW: r({ () -> if (2 > 3) { return@l } }) -> -@l{ () -> if (2 > 3) { return@l } } : * COPY -{ 1 @l{ () -> if (2 > 3) { return@l } } } : * COPY +l@{ () -> if (2 > 3) { return@l } } : * COPY +{ 1 l@{ () -> if (2 > 3) { return@l } } } : * COPY 2 : * NEW: r(2) -> { 2 } : * COPY -try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } : * NEW: merge(try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 }|) -> -{ try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } } : * COPY +try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 } : * NEW: merge(try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 }|) -> +{ try { 1 l@{ () -> if (2 > 3) { return@l } } } finally { 2 } } : * COPY ===================== == anonymous_0 == { () -> @@ -79,7 +79,7 @@ if (2 > 3) { return@l } : * COPY ===================== == t4 == fun t4() { - @l{ () -> + l@{ () -> try { 1 if (2 > 3) { @@ -92,8 +92,8 @@ fun t4() { } --------------------- { () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } : * NEW: r({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> -@l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } : * COPY -{ @l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } } : * COPY +l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } : * COPY +{ l@{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } } : * COPY ===================== == anonymous_1 == { () -> @@ -122,11 +122,11 @@ try { 1 if (2 > 3) { return@l } } finally { 2 } : * C ===================== == t5 == fun t5() { - @l while(true) { + l@ while(true) { try { 1 if (2 > 3) { - break @l + break@l } } finally { 2 @@ -134,31 +134,31 @@ fun t5() { } } --------------------- - : * NEW: magic[VALUE_CONSUMER](true|) -> -true : Boolean NEW: r(true) -> -1 : * NEW: r(1) -> -2 : {<: Comparable} NEW: r(2) -> -3 : Int NEW: r(3) -> -2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> -break @l !: * -{ break @l } !: * COPY -if (2 > 3) { break @l } : * NEW: merge(if (2 > 3) { break @l }|!) -> -{ 1 if (2 > 3) { break @l } } : * COPY -2 : * NEW: r(2) -> -{ 2 } : * COPY -try { 1 if (2 > 3) { break @l } } finally { 2 } : * NEW: merge(try { 1 if (2 > 3) { break @l } } finally { 2 }|) -> -{ try { 1 if (2 > 3) { break @l } } finally { 2 } } : * COPY -while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } } !: * -@l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } } !: * COPY -{ @l while(true) { try { 1 if (2 > 3) { break @l } } finally { 2 } } } !: * COPY + : * NEW: magic[VALUE_CONSUMER](true|) -> +true : Boolean NEW: r(true) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> +break@l !: * +{ break@l } !: * COPY +if (2 > 3) { break@l } : * NEW: merge(if (2 > 3) { break@l }|!) -> +{ 1 if (2 > 3) { break@l } } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { 1 if (2 > 3) { break@l } } finally { 2 } : * NEW: merge(try { 1 if (2 > 3) { break@l } } finally { 2 }|) -> +{ try { 1 if (2 > 3) { break@l } } finally { 2 } } : * COPY +while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } !: * +l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } !: * COPY +{ l@ while(true) { try { 1 if (2 > 3) { break@l } } finally { 2 } } } !: * COPY ===================== == t6 == fun t6() { try { - @l while(true) { + l@ while(true) { 1 if (2 > 3) { - break @l + break@l } } 5 @@ -167,32 +167,32 @@ fun t6() { } } --------------------- - : * NEW: magic[VALUE_CONSUMER](true|) -> -true : Boolean NEW: r(true) -> -1 : * NEW: r(1) -> -2 : {<: Comparable} NEW: r(2) -> -3 : Int NEW: r(3) -> -2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> -break @l !: * -{ break @l } !: * COPY -if (2 > 3) { break @l } : * NEW: merge(if (2 > 3) { break @l }|!) -> -{ 1 if (2 > 3) { break @l } } : * COPY -while(true) { 1 if (2 > 3) { break @l } } !: * -@l while(true) { 1 if (2 > 3) { break @l } } !: * COPY -5 : * NEW: r(5) -> -{ @l while(true) { 1 if (2 > 3) { break @l } } 5 } : * COPY -2 : * NEW: r(2) -> -{ 2 } : * COPY -try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 } : * NEW: merge(try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 }|) -> -{ try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 } } : * COPY + : * NEW: magic[VALUE_CONSUMER](true|) -> +true : Boolean NEW: r(true) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> +break@l !: * +{ break@l } !: * COPY +if (2 > 3) { break@l } : * NEW: merge(if (2 > 3) { break@l }|!) -> +{ 1 if (2 > 3) { break@l } } : * COPY +while(true) { 1 if (2 > 3) { break@l } } !: * +l@ while(true) { 1 if (2 > 3) { break@l } } !: * COPY +5 : * NEW: r(5) -> +{ l@ while(true) { 1 if (2 > 3) { break@l } } 5 } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 } : * NEW: merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 }|) -> +{ try { l@ while(true) { 1 if (2 > 3) { break@l } } 5 } finally { 2 } } : * COPY ===================== == t7 == fun t7() { try { - @l while(true) { + l@ while(true) { 1 if (2 > 3) { - break @l + break@l } } } finally { @@ -200,31 +200,31 @@ fun t7() { } } --------------------- - : * NEW: magic[VALUE_CONSUMER](true|) -> -true : Boolean NEW: r(true) -> -1 : * NEW: r(1) -> -2 : {<: Comparable} NEW: r(2) -> -3 : Int NEW: r(3) -> -2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> -break @l !: * -{ break @l } !: * COPY -if (2 > 3) { break @l } : * NEW: merge(if (2 > 3) { break @l }|!) -> -{ 1 if (2 > 3) { break @l } } : * COPY -while(true) { 1 if (2 > 3) { break @l } } !: * -@l while(true) { 1 if (2 > 3) { break @l } } !: * COPY -{ @l while(true) { 1 if (2 > 3) { break @l } } } !: * COPY -2 : * NEW: r(2) -> -{ 2 } : * COPY -try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 } : * NEW: merge(try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 }|!) -> -{ try { @l while(true) { 1 if (2 > 3) { break @l } } } finally { 2 } } : * COPY + : * NEW: magic[VALUE_CONSUMER](true|) -> +true : Boolean NEW: r(true) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> +break@l !: * +{ break@l } !: * COPY +if (2 > 3) { break@l } : * NEW: merge(if (2 > 3) { break@l }|!) -> +{ 1 if (2 > 3) { break@l } } : * COPY +while(true) { 1 if (2 > 3) { break@l } } !: * +l@ while(true) { 1 if (2 > 3) { break@l } } !: * COPY +{ l@ while(true) { 1 if (2 > 3) { break@l } } } !: * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 } : * NEW: merge(try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 }|!) -> +{ try { l@ while(true) { 1 if (2 > 3) { break@l } } } finally { 2 } } : * COPY ===================== == t8 == fun t8(a : Int) { - @l for (i in 1..a) { + l@ for (i in 1..a) { try { 1 if (2 > 3) { - continue @l + continue@l } } finally { 2 @@ -232,34 +232,34 @@ fun t8(a : Int) { } } --------------------- - : Int NEW: magic[FAKE_INITIALIZER](a : Int) -> - : Int NEW: magic[LOOP_RANGE_ITERATION](1..a|) -> -1 : Int NEW: r(1) -> -a : Int NEW: r(a) -> -1..a : {<: Iterable} NEW: call(1..a, rangeTo|, ) -> -1 : * NEW: r(1) -> -2 : {<: Comparable} NEW: r(2) -> -3 : Int NEW: r(3) -> -2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> -continue @l !: * -{ continue @l } !: * COPY -if (2 > 3) { continue @l } : * NEW: merge(if (2 > 3) { continue @l }|!) -> -{ 1 if (2 > 3) { continue @l } } : * COPY -2 : * NEW: r(2) -> -{ 2 } : * COPY -try { 1 if (2 > 3) { continue @l } } finally { 2 } : * NEW: merge(try { 1 if (2 > 3) { continue @l } } finally { 2 }|) -> -{ try { 1 if (2 > 3) { continue @l } } finally { 2 } } : * COPY -for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } } !: * -@l for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } } !: * COPY -{ @l for (i in 1..a) { try { 1 if (2 > 3) { continue @l } } finally { 2 } } } !: * COPY + : Int NEW: magic[FAKE_INITIALIZER](a : Int) -> + : Int NEW: magic[LOOP_RANGE_ITERATION](1..a|) -> +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +1..a : {<: Iterable} NEW: call(1..a, rangeTo|, ) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> +continue@l !: * +{ continue@l } !: * COPY +if (2 > 3) { continue@l } : * NEW: merge(if (2 > 3) { continue@l }|!) -> +{ 1 if (2 > 3) { continue@l } } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { 1 if (2 > 3) { continue@l } } finally { 2 } : * NEW: merge(try { 1 if (2 > 3) { continue@l } } finally { 2 }|) -> +{ try { 1 if (2 > 3) { continue@l } } finally { 2 } } : * COPY +for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } !: * +l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } !: * COPY +{ l@ for (i in 1..a) { try { 1 if (2 > 3) { continue@l } } finally { 2 } } } !: * COPY ===================== == t9 == fun t9(a : Int) { try { - @l for (i in 1..a) { + l@ for (i in 1..a) { 1 if (2 > 3) { - continue @l + continue@l } } 5 @@ -268,35 +268,35 @@ fun t9(a : Int) { } } --------------------- - : Int NEW: magic[FAKE_INITIALIZER](a : Int) -> - : Int NEW: magic[LOOP_RANGE_ITERATION](1..a|) -> -1 : Int NEW: r(1) -> -a : Int NEW: r(a) -> -1..a : {<: Iterable} NEW: call(1..a, rangeTo|, ) -> -1 : * NEW: r(1) -> -2 : {<: Comparable} NEW: r(2) -> -3 : Int NEW: r(3) -> -2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> -continue @l !: * -{ continue @l } !: * COPY -if (2 > 3) { continue @l } : * NEW: merge(if (2 > 3) { continue @l }|!) -> -{ 1 if (2 > 3) { continue @l } } : * COPY -for (i in 1..a) { 1 if (2 > 3) { continue @l } } !: * -@l for (i in 1..a) { 1 if (2 > 3) { continue @l } } !: * COPY -5 : * NEW: r(5) -> -{ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } : * COPY -2 : * NEW: r(2) -> -{ 2 } : * COPY -try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 } : * NEW: merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 }|) -> -{ try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 } } : * COPY + : Int NEW: magic[FAKE_INITIALIZER](a : Int) -> + : Int NEW: magic[LOOP_RANGE_ITERATION](1..a|) -> +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +1..a : {<: Iterable} NEW: call(1..a, rangeTo|, ) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> +continue@l !: * +{ continue@l } !: * COPY +if (2 > 3) { continue@l } : * NEW: merge(if (2 > 3) { continue@l }|!) -> +{ 1 if (2 > 3) { continue@l } } : * COPY +for (i in 1..a) { 1 if (2 > 3) { continue@l } } !: * +l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } !: * COPY +5 : * NEW: r(5) -> +{ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 } : * NEW: merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 }|) -> +{ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } 5 } finally { 2 } } : * COPY ===================== == t10 == fun t10(a : Int) { try { - @l for (i in 1..a) { + l@ for (i in 1..a) { 1 if (2 > 3) { - continue @l + continue@l } } } finally { @@ -304,26 +304,26 @@ fun t10(a : Int) { } } --------------------- - : Int NEW: magic[FAKE_INITIALIZER](a : Int) -> - : Int NEW: magic[LOOP_RANGE_ITERATION](1..a|) -> -1 : Int NEW: r(1) -> -a : Int NEW: r(a) -> -1..a : {<: Iterable} NEW: call(1..a, rangeTo|, ) -> -1 : * NEW: r(1) -> -2 : {<: Comparable} NEW: r(2) -> -3 : Int NEW: r(3) -> -2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> -continue @l !: * -{ continue @l } !: * COPY -if (2 > 3) { continue @l } : * NEW: merge(if (2 > 3) { continue @l }|!) -> -{ 1 if (2 > 3) { continue @l } } : * COPY -for (i in 1..a) { 1 if (2 > 3) { continue @l } } !: * -@l for (i in 1..a) { 1 if (2 > 3) { continue @l } } !: * COPY -{ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } !: * COPY -2 : * NEW: r(2) -> -{ 2 } : * COPY -try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 } : * NEW: merge(try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 }|!) -> -{ try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } } finally { 2 } } : * COPY + : Int NEW: magic[FAKE_INITIALIZER](a : Int) -> + : Int NEW: magic[LOOP_RANGE_ITERATION](1..a|) -> +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +1..a : {<: Iterable} NEW: call(1..a, rangeTo|, ) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(2 > 3, compareTo|, ) -> +continue@l !: * +{ continue@l } !: * COPY +if (2 > 3) { continue@l } : * NEW: merge(if (2 > 3) { continue@l }|!) -> +{ 1 if (2 > 3) { continue@l } } : * COPY +for (i in 1..a) { 1 if (2 > 3) { continue@l } } !: * +l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } !: * COPY +{ l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } !: * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 } : * NEW: merge(try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 }|!) -> +{ try { l@ for (i in 1..a) { 1 if (2 > 3) { continue@l } } } finally { 2 } } : * COPY ===================== == t11 == fun t11() { diff --git a/compiler/testData/cfg/expressions/labeledExpression.instructions b/compiler/testData/cfg/expressions/labeledExpression.instructions index 060efe6d18b..196a08d640f 100644 --- a/compiler/testData/cfg/expressions/labeledExpression.instructions +++ b/compiler/testData/cfg/expressions/labeledExpression.instructions @@ -1,14 +1,14 @@ == foo == fun foo(): Int { - val t = @x (1 + 2) + val t = x@ (1 + 2) return t } --------------------- L0: 1 - 2 mark({ val t = @x (1 + 2) return t }) - v(val t = @x (1 + 2)) - mark(@x (1 + 2)) + 2 mark({ val t = x@ (1 + 2) return t }) + v(val t = x@ (1 + 2)) + mark(x@ (1 + 2)) mark((1 + 2)) r(1) -> r(2) -> diff --git a/compiler/testData/cfg/expressions/labeledExpression.kt b/compiler/testData/cfg/expressions/labeledExpression.kt index 5ad178fddf0..e1517352c4d 100644 --- a/compiler/testData/cfg/expressions/labeledExpression.kt +++ b/compiler/testData/cfg/expressions/labeledExpression.kt @@ -1,4 +1,4 @@ fun foo(): Int { - val t = @x (1 + 2) + val t = x@ (1 + 2) return t } \ No newline at end of file diff --git a/compiler/testData/cfg/expressions/labeledExpression.values b/compiler/testData/cfg/expressions/labeledExpression.values index 2276e1a1b96..1cc26531981 100644 --- a/compiler/testData/cfg/expressions/labeledExpression.values +++ b/compiler/testData/cfg/expressions/labeledExpression.values @@ -1,6 +1,6 @@ == foo == fun foo(): Int { - val t = @x (1 + 2) + val t = x@ (1 + 2) return t } --------------------- @@ -8,8 +8,8 @@ fun foo(): Int { 2 : Int NEW: r(2) -> 1 + 2 : Int NEW: call(1 + 2, plus|, ) -> (1 + 2) : Int COPY -@x (1 + 2) : Int COPY +x@ (1 + 2) : Int COPY t : Int NEW: r(t) -> return t !: * -{ val t = @x (1 + 2) return t } !: * COPY +{ val t = x@ (1 + 2) return t } !: * COPY ===================== diff --git a/compiler/testData/codegen/box/classes/kt454.kt b/compiler/testData/codegen/box/classes/kt454.kt index 7bf4908df23..be3994d660c 100644 --- a/compiler/testData/codegen/box/classes/kt454.kt +++ b/compiler/testData/codegen/box/classes/kt454.kt @@ -1,5 +1,5 @@ fun box(): String { - var s1 = (@l1 "s") - val s2 = (@l2 if (@l3 true) s1 else null) + var s1 = (l1@ "s") + val s2 = (l2@ if (l3@ true) s1 else null) return if (s2 == "s") "OK" else "fail" } diff --git a/compiler/testData/codegen/box/closures/localReturn.kt b/compiler/testData/codegen/box/closures/localReturn.kt index d7dfe040b2e..c3edefe3626 100644 --- a/compiler/testData/codegen/box/closures/localReturn.kt +++ b/compiler/testData/codegen/box/closures/localReturn.kt @@ -1,13 +1,13 @@ fun box(): String { val a = 1 - val explicitlyReturned = run1 @f{ + val explicitlyReturned = run1 f@{ if (a > 0) return@f "OK" else "Fail 1" } if (explicitlyReturned != "OK") return explicitlyReturned - val implicitlyReturned = run1 @f{ + val implicitlyReturned = run1 f@{ if (a < 0) return@f "Fail 2" else "OK" diff --git a/compiler/testData/codegen/box/controlStructures/continueToLabelInFor.kt b/compiler/testData/codegen/box/controlStructures/continueToLabelInFor.kt index 2ccc98c632b..82be0f78314 100644 --- a/compiler/testData/codegen/box/controlStructures/continueToLabelInFor.kt +++ b/compiler/testData/codegen/box/controlStructures/continueToLabelInFor.kt @@ -1,7 +1,7 @@ fun for_int_range(): Int { var c = 0 - @loop for (i in 1..10) { - if (c >= 5) continue @loop + loop@ for (i in 1..10) { + if (c >= 5) continue@loop c++ } return c @@ -11,8 +11,8 @@ fun for_byte_range(): Int { var c = 0 val from: Byte = 1 val to: Byte = 10 - @loop for (i in from..to) { - if (c >= 5) continue @loop + loop@ for (i in from..to) { + if (c >= 5) continue@loop c++ } return c @@ -22,8 +22,8 @@ fun for_long_range(): Int { var c = 0 val from: Long = 1 val to: Long = 10 - @loop for (i in from..to) { - if (c >= 5) continue @loop + loop@ for (i in from..to) { + if (c >= 5) continue@loop c++ } return c @@ -34,8 +34,8 @@ fun for_int_list(): Int { a.add(0); a.add(0); a.add(0); a.add(0); a.add(0) a.add(0); a.add(0); a.add(0); a.add(0); a.add(0) var c = 0 - @loop for (i in a) { - if (c >= 5) continue @loop + loop@ for (i in a) { + if (c >= 5) continue@loop c++ } return c @@ -46,8 +46,8 @@ fun for_byte_list(): Int { a.add(0); a.add(0); a.add(0); a.add(0); a.add(0) a.add(0); a.add(0); a.add(0); a.add(0); a.add(0) var c = 0 - @loop for (i in a) { - if (c >= 5) continue @loop + loop@ for (i in a) { + if (c >= 5) continue@loop c++ } return c @@ -58,8 +58,8 @@ fun for_long_list(): Int { a.add(0); a.add(0); a.add(0); a.add(0); a.add(0) a.add(0); a.add(0); a.add(0); a.add(0); a.add(0) var c = 0 - @loop for (i in a) { - if (c >= 5) continue @loop + loop@ for (i in a) { + if (c >= 5) continue@loop c++ } return c @@ -70,8 +70,8 @@ fun for_double_list(): Int { a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0) a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0) var c = 0 - @loop for (i in a) { - if (c >= 5) continue @loop + loop@ for (i in a) { + if (c >= 5) continue@loop c++ } return c @@ -82,8 +82,8 @@ fun for_object_list(): Int { a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0) a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0); a.add(0.0) var c = 0 - @loop for (i in a) { - if (c >= 5) continue @loop + loop@ for (i in a) { + if (c >= 5) continue@loop c++ } return c @@ -92,8 +92,8 @@ fun for_object_list(): Int { fun for_str_array(): Int { val a = arrayOfNulls(10) var c = 0 - @loop for (i in a) { - if (c >= 5) continue @loop + loop@ for (i in a) { + if (c >= 5) continue@loop c++ } return c @@ -102,8 +102,8 @@ fun for_str_array(): Int { fun for_intarray(): Int { val a = IntArray(10) var c = 0 - @loop for (i in a) { - if (c >= 5) continue @loop + loop@ for (i in a) { + if (c >= 5) continue@loop c++ } return c diff --git a/compiler/testData/codegen/box/functions/functionExpression/functionExpression.kt b/compiler/testData/codegen/box/functions/functionExpression/functionExpression.kt index bf0c522d25f..49cfea50d5b 100644 --- a/compiler/testData/codegen/box/functions/functionExpression/functionExpression.kt +++ b/compiler/testData/codegen/box/functions/functionExpression/functionExpression.kt @@ -22,10 +22,10 @@ fun box() : String { if (1.a() != 2) return "test 8 failed" val b = ( fun Int.() = this + 1) if (1.b() != 2) return "test 9 failed" - val c = (@c fun Int.() = this + 1) + val c = (c@ fun Int.() = this + 1) if (1.c() != 2) return "test 10 failed" - val d = @d fun (): Int { return@d 4} + val d = d@ fun (): Int { return@d 4} if (d() != 4) return "test 11 failed" return "OK" diff --git a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt index b736dc45b74..86e94348762 100644 --- a/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt +++ b/compiler/testData/codegen/box/functions/functionExpression/functionExpressionWithName.kt @@ -22,7 +22,7 @@ fun box() : String { if (1.a() != 2) return "test 8 failed" val b = ( fun Int.name() = this + 1) if (1.b() != 2) return "test 9 failed" - val c = (@c fun Int.name() = this + 1) + val c = (c@ fun Int.name() = this + 1) if (1.c() != 2) return "test 10 failed" val d = fun name(): Int { return@name 4} diff --git a/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt b/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt index 4fc99057d94..2597c1a4189 100644 --- a/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt +++ b/compiler/testData/codegen/box/functions/localReturnInsideFunctionExpression.kt @@ -3,8 +3,8 @@ fun simple() = fun (): Boolean { return true } fun simpleNamed() = fun name(): Boolean { return true } fun simpleNamed2() = fun name(): Boolean { return@name true } -fun withLabel() = @l fun (): Boolean { return@l true } -fun withLabelNamed() = @l fun name(): Boolean { return@l true } +fun withLabel() = l@ fun (): Boolean { return@l true } +fun withLabelNamed() = l@ fun name(): Boolean { return@l true } fun box(): String { if (!simple()()) return "Test simple failed" diff --git a/compiler/testData/codegen/box/intrinsics/incWithLabel.kt b/compiler/testData/codegen/box/intrinsics/incWithLabel.kt index ba65888e61e..5eea76e2c10 100644 --- a/compiler/testData/codegen/box/intrinsics/incWithLabel.kt +++ b/compiler/testData/codegen/box/intrinsics/incWithLabel.kt @@ -1,7 +1,7 @@ fun box(): String { var x = 1 - (@foo x)++ - ++(@foo x) + (foo@ x)++ + ++(foo@ x) (x: Int)++ ++(x: Int) diff --git a/compiler/testData/codegen/box/labels/labeledDeclarations.kt b/compiler/testData/codegen/box/labels/labeledDeclarations.kt index ca0098fa8e6..5b407c979fb 100644 --- a/compiler/testData/codegen/box/labels/labeledDeclarations.kt +++ b/compiler/testData/codegen/box/labels/labeledDeclarations.kt @@ -2,9 +2,9 @@ data class A(val a: Int, val b: Int) fun box() : String { - @a val x = 1 - @b fun a() = 2 - @c val (z, z2) = A(1, 2) + a@ val x = 1 + b@ fun a() = 2 + c@ val (z, z2) = A(1, 2) if (x != 1) return "fail 1" diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/bracket.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/bracket.1.kt index de5a4790e99..294eecda22a 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/bracket.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/bracket.1.kt @@ -1,7 +1,7 @@ import test.* fun test1(b: Boolean): String { - val localResult = doCall ((@local { + val localResult = doCall ((local@ { if (b) { return@local "local" } else { diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/labeled.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/labeled.1.kt index 2dae9289747..411ff7e8d21 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/labeled.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/deparenthesize/labeled.1.kt @@ -1,7 +1,7 @@ import test.* fun test1(b: Boolean): String { - val localResult = doCall @local { + val localResult = doCall local@ { if (b) { return@local "local" } else { diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.1.kt index 2dae9289747..411ff7e8d21 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/explicitLocalReturn.1.kt @@ -1,7 +1,7 @@ import test.* fun test1(b: Boolean): String { - val localResult = doCall @local { + val localResult = doCall local@ { if (b) { return@local "local" } else { diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/nestedNonLocals.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/nestedNonLocals.1.kt index f707baa8f93..fdc3e2eb474 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/nestedNonLocals.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/nestedNonLocals.1.kt @@ -15,9 +15,9 @@ class Global(val value: String) fun test1(intKind: Kind, extKind: Kind): Global { - var externalResult = doCall @ext { + var externalResult = doCall ext@ { - val internalResult = doCall @int { + val internalResult = doCall int@ { if (intKind == Kind.GLOBAL) { return@test1 Global("internal -> global") } else if (intKind == EXTERNAL) { diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/noInlineLocalReturn.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/noInlineLocalReturn.1.kt index 896835c77d5..f438dd7ac3b 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/noInlineLocalReturn.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/noInlineLocalReturn.1.kt @@ -2,7 +2,7 @@ import test.* fun test1(b: Boolean): String { - val localResult = noInlineCall @local { + val localResult = noInlineCall local@ { if (b) { return@local 1 } else { diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt index 4518ac23c79..e0b116c7ec5 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/returnFromFunctionExpr.1.kt @@ -4,12 +4,12 @@ fun test(): String = fun (): String { return "fail" } () -fun test2(): String = (@l fun (): String { +fun test2(): String = (l@ fun (): String { foo { return@l "OK" } return "fail" }) () -fun test3(): String = (@l fun bar(): String { +fun test3(): String = (l@ fun bar(): String { foo { return@bar "OK" } return "fail" }) () diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/callSite/callSite.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/callSite/callSite.1.kt index 829e3a5b0a7..f250c83aeea 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/callSite/callSite.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/callSite/callSite.1.kt @@ -22,10 +22,10 @@ class Global(val value: String) fun test1(intKind: Kind, extKind: Kind, holder: Holder): Global { holder.value = "" try { - var externalResult = doCall @ext { + var externalResult = doCall ext@ { try { - val internalResult = doCall @int { + val internalResult = doCall int@ { try { if (intKind == Kind.GLOBAL) { return@test1 Global("internal -> global") diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/complex.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/complex.1.kt index 519931ef7b7..30f3870579c 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/complex.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/complex.1.kt @@ -22,10 +22,10 @@ class Global(val value: String) fun test1(intKind: Kind, extKind: Kind, holder: Holder): Global { holder.value = "" try { - var externalResult = doCall (@ext { + var externalResult = doCall (ext@ { try { - val internalResult = doCall (@int { + val internalResult = doCall (int@ { try { if (intKind == Kind.GLOBAL) { return@test1 Global("internal -> global") diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTry.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTry.1.kt index 41b621327b9..7c79a671715 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTry.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTry.1.kt @@ -17,7 +17,7 @@ fun test1(h: Holder): String { fun test2(h: Holder): String { - val localResult = doCall (@lambda { + val localResult = doCall (lambda@ { h.value += "OK_LOCAL" return@lambda "OK_LOCAL" }, { diff --git a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTryAndFinally.1.kt b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTryAndFinally.1.kt index 5d11bfa9a55..507327d977c 100644 --- a/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTryAndFinally.1.kt +++ b/compiler/testData/codegen/boxInline/nonLocalReturns/tryFinally/declSite/returnInTryAndFinally.1.kt @@ -21,7 +21,7 @@ fun test1(h: Holder): String { fun test2(h: Holder): String { val localResult = doCall ( - @lambda { + lambda@ { h.value += "OK_NONLOCAL" return@lambda "OK_NONLOCAL" }, { @@ -51,7 +51,7 @@ fun test4(h: Holder): String { h.value += "OK_NONLOCAL" return "OK_NONLOCAL" }, - @l2 { + l2@ { h.value += ", OK_FINALLY" return@l2 "OK_FINALLY" }) diff --git a/compiler/testData/codegen/boxWithStdlib/regressions/kt998.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt998.kt index a9a3296dae0..08e2887f04b 100644 --- a/compiler/testData/codegen/boxWithStdlib/regressions/kt998.kt +++ b/compiler/testData/codegen/boxWithStdlib/regressions/kt998.kt @@ -1,5 +1,5 @@ fun findPairless(a : IntArray) : Int { - @loop for (i in a.indices) { + loop@ for (i in a.indices) { for (j in a.indices) { if (i != j && a[i] == a[j]) continue@loop } @@ -10,7 +10,7 @@ fun findPairless(a : IntArray) : Int { fun hasDuplicates(a : IntArray) : Boolean { var duplicate = false - @loop for (i in a.indices) { + loop@ for (i in a.indices) { for (j in a.indices) { if (i != j && a[i] == a[j]) { duplicate = true diff --git a/compiler/testData/codegen/bytecodeText/prefixIntVarIncrement.kt b/compiler/testData/codegen/bytecodeText/prefixIntVarIncrement.kt index e0036aa566d..aad196027db 100644 --- a/compiler/testData/codegen/bytecodeText/prefixIntVarIncrement.kt +++ b/compiler/testData/codegen/bytecodeText/prefixIntVarIncrement.kt @@ -1,9 +1,9 @@ fun main(args: Array) { var i = 10 ++i - ++(@l i) + ++(l@ i) ++(i: Int) - ++(@l (i: Int)) + ++(l@ (i: Int)) } // 4 IINC \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/statements/labeled.kt b/compiler/testData/codegen/bytecodeText/statements/labeled.kt index 995d5a8b8e9..e916024572a 100644 --- a/compiler/testData/codegen/bytecodeText/statements/labeled.kt +++ b/compiler/testData/codegen/bytecodeText/statements/labeled.kt @@ -1,6 +1,6 @@ fun main() { - @l if (2 != 1) "fail 3" + l@ if (2 != 1) "fail 3" } // 0 GETSTATIC \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/BreakContinue.kt b/compiler/testData/diagnostics/tests/BreakContinue.kt index c4dd5a0e2ca..db3eb8c36a2 100644 --- a/compiler/testData/diagnostics/tests/BreakContinue.kt +++ b/compiler/testData/diagnostics/tests/BreakContinue.kt @@ -1,8 +1,8 @@ class C { fun f (a : Boolean, b : Boolean) { - @b while (true) - @a { + b@ while (true) + a@ { break@f break break@b @@ -11,8 +11,8 @@ class C { continue - @b while (true) - @a { + b@ while (true) + a@ { continue@f continue continue@b @@ -42,21 +42,21 @@ class C { } fun containsBreakWithLabel(a: String?) { - @loop while(a == null) { + loop@ while(a == null) { break@loop } a?.compareTo("2") } fun containsIllegalBreak(a: String?) { - @loop while(a == null) { + loop@ while(a == null) { break@label } a.compareTo("2") } fun containsBreakToOuterLoop(a: String?, b: String?) { - @loop while(b == null) { + loop@ while(b == null) { while(a == null) { break@loop } @@ -65,7 +65,7 @@ class C { } fun containsBreakInsideLoopWithLabel(a: String?, array: Array) { - @l while(a == null) { + l@ while(a == null) { for (el in array) { break@l } @@ -75,7 +75,7 @@ class C { fun unresolvedBreak(a: String?, array: Array) { while(a == null) { - @l for (el in array) { + l@ for (el in array) { break } if (true) break else break@l diff --git a/compiler/testData/diagnostics/tests/BreakContinueInWhen.kt b/compiler/testData/diagnostics/tests/BreakContinueInWhen.kt index 5fac2451d9a..8d6e7af7fc5 100644 --- a/compiler/testData/diagnostics/tests/BreakContinueInWhen.kt +++ b/compiler/testData/diagnostics/tests/BreakContinueInWhen.kt @@ -46,7 +46,7 @@ fun breakContinueInWhenWithDoWhile(i: Int, j: Int) { } fun labeledBreakContinue(i: Int) { - @outer for (y in 0..10) { + outer@ for (y in 0..10) { when (i) { 0 -> continue@outer 1 -> break@outer diff --git a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt index 7363b659226..0ef267c2127 100644 --- a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt +++ b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt @@ -56,7 +56,7 @@ fun main1() { {1}(); (fun (x : Int) = x)(1) 1.(fun Int.(x : Int) = x)(1); - @l{1}() + l@{1}() 1.((fun Int.() = 1))() 1.(f())() 1.if(true){f()}else{f()}() diff --git a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt index f24d3f89bed..873013f7840 100644 --- a/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt +++ b/compiler/testData/diagnostics/tests/FunctionReturnTypes.kt @@ -8,10 +8,10 @@ fun unitEmptyReturn() : Unit {return} fun unitIntReturn() : Unit {return 1} fun unitUnitReturn() : Unit {return Unit} fun test1() : Any = {return} -fun test2() : Any = @a {return@a 1} +fun test2() : Any = a@ {return@a 1} fun test3() : Any { return } fun test4(): ()-> Unit = { return@test4 } -fun test5(): Any = @l{ return@l } +fun test5(): Any = l@{ return@l } fun test6(): Any = {return 1} fun bbb() { diff --git a/compiler/testData/diagnostics/tests/LValueAssignment.kt b/compiler/testData/diagnostics/tests/LValueAssignment.kt index baf5760f486..22a6cc0711c 100644 --- a/compiler/testData/diagnostics/tests/LValueAssignment.kt +++ b/compiler/testData/diagnostics/tests/LValueAssignment.kt @@ -54,17 +54,17 @@ fun cannotBe() { fun canBe(i0: Int, j: Int) { var i = i0 (i: Int) = 36 - (@label i) = 34 + (label@ i) = 34 (j: Int) = 36 - (@label j) = 34 //repeat for j + (label@ j) = 34 //repeat for j val a = A() - (@l a.a) = 3894 + (l@ a.a) = 3894 } fun canBe2(j: Int) { - (@label j) = 34 + (label@ j) = 34 } class A() { @@ -75,18 +75,18 @@ class Test() { fun testIllegalValues() { 1 += 23 (1 : Int) += 43 - (@l 1) += 23 + (l@ 1) += 23 getInt() += 343 - (@f getInt()) += 343 + (f@ getInt()) += 343 (getInt() : Int) += 343 1++ - (@r 1)++ + (r@ 1)++ (1 : Int)++ getInt()++ - (@m getInt())++ + (m@ getInt())++ (getInt() : Int)++ this++ @@ -94,7 +94,7 @@ class Test() { var s : String = "r" s += "ss" s += this - s += (@a 2) + s += (a@ 2) } fun testVariables() { @@ -102,13 +102,13 @@ class Test() { val b: Int = 34 a += 34 - (@l a) += 34 + (l@ a) += 34 (a : Int) += 34 b += 34 a++ - (@l a)++ + (l@ a)++ (a : Int)++ (a)++ } @@ -116,7 +116,7 @@ class Test() { fun testVariables1() { val b: Int = 34 - (@l b) += 34 + (l@ b) += 34 //repeat for b (b : Int) += 34 (b) += 3 @@ -130,7 +130,7 @@ class Test() { ab.getArray()[54] = 23 ab.getArray()[54]++ - (@f a)[3] = 4 + (f@ a)[3] = 4 (a : Array)[4]++ (ab.getArray() : Array)[54] += 43 diff --git a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt index d66d11cb20d..19bbc758b52 100644 --- a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt +++ b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt @@ -21,6 +21,6 @@ fun main(args : Array) { System is Int System() (System) - @foo System + foo@ System null in System } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/breakOrContinueInLoopCondition.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/breakOrContinueInLoopCondition.kt index 82951bdf1c8..0caa439bb92 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/breakOrContinueInLoopCondition.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/breakOrContinueInLoopCondition.kt @@ -1,13 +1,13 @@ fun test() { - @l for (i in if (true) 1..10 else continue@l) {} + l@ for (i in if (true) 1..10 else continue@l) {} for (i in if (true) 1..10 else continue) {} while (break) {} - @l while (break@l) {} + l@ while (break@l) {} do {} while (continue) - @l do {} while (continue@l) + l@ do {} while (continue@l) //KT-5704 var i = 0 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt index 7640277569f..fa253f1cd4a 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt @@ -12,7 +12,7 @@ fun test2() { bar(11, todo()/*comment1*/, ""/*comment2*/) } fun test3() { - bar(11, @l(todo()/*comment*/), "") + bar(11, l@(todo()/*comment*/), "") } fun todo() = throw Exception() diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/kt5200DeadCodeInLambdas.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/kt5200DeadCodeInLambdas.kt index 83011b093e7..3bacd0f0967 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/kt5200DeadCodeInLambdas.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/kt5200DeadCodeInLambdas.kt @@ -1,7 +1,7 @@ //KT-5200 Mark unreachable code in lambdas fun test1(): String { - doCall @local { + doCall local@ { throw NullPointerException() "b3" //unmarked } @@ -10,7 +10,7 @@ fun test1(): String { } fun test2(nonLocal: String, b: Boolean): String { - doCall @local { + doCall local@ { if (b) { return@local "b1" } else { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt index 346fbe1bcca..07b6585530b 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt @@ -5,7 +5,7 @@ class TestFunctionLiteral { val sum: (Int) -> Int = { x: Int -> sum(x - 1) + x } - val foo: () -> Unit = @l ({ foo() }) + val foo: () -> Unit = l@ ({ foo() }) } open class A(val a: A) @@ -19,7 +19,7 @@ class TestObjectLiteral { val y = obj } } - val obj1: A = @l ( object: A(obj1) { + val obj1: A = l@ ( object: A(obj1) { init { val x = obj1 } diff --git a/compiler/testData/diagnostics/tests/controlStructures/jumpAcrossFunctionBoundary.kt b/compiler/testData/diagnostics/tests/controlStructures/jumpAcrossFunctionBoundary.kt index b46f894c48c..98b7d7f6f5f 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/jumpAcrossFunctionBoundary.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/jumpAcrossFunctionBoundary.kt @@ -1,7 +1,7 @@ fun call(f: () -> Unit) = f() fun f1() { - @outer while (true) { + outer@ while (true) { call { break@outer } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ContinueOuterLoop.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ContinueOuterLoop.kt index 528ebe653d0..4ca5193eb55 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ContinueOuterLoop.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ContinueOuterLoop.kt @@ -1,7 +1,7 @@ fun whileLoop(x: Int?) { - @outer while (x != 0) { + outer@ while (x != 0) { while (x != 1) { - if (x == 2) continue @outer + if (x == 2) continue@outer } x : Int } @@ -9,9 +9,9 @@ fun whileLoop(x: Int?) { } fun doWhileLoop(x: Int?) { - @outer while (x != 0) { + outer@ while (x != 0) { do { - if (x == 2) continue @outer + if (x == 2) continue@outer } while (x == null) x : Int } @@ -19,10 +19,10 @@ fun doWhileLoop(x: Int?) { } fun whileLoopContinueInnerOuter(x: Int?) { - @outer while (x != 0) { - @inner while (x != 1) { + outer@ while (x != 0) { + inner@ while (x != 1) { while (x != 2) { - if (x == 3) continue @inner + if (x == 3) continue@inner } x : Int } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt index ee08686c9eb..698667649c3 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt @@ -1,5 +1,5 @@ class A3 { - val a: String by @l MyProperty() + val a: String by l@ MyProperty() class MyProperty {} diff --git a/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt b/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt index 31e692c4342..444b3845c71 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt @@ -1,3 +1,3 @@ fun test() { - (@d val bar = 2) + (d@ val bar = 2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt index 70153096cc2..a5752076b26 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt @@ -2,19 +2,19 @@ package m fun test(i: Int?) { if (i != null) { - foo(@l1 i) + foo(l1@ i) foo((i)) - foo(@l2 (i)) - foo((@l3 i)) + foo(l2@ (i)) + foo((l3@ i)) } - val a: Int = @l4 "" + val a: Int = l4@ "" val b: Int = ("") val c: Int = "": Int val d: Int = "": Long - foo(@l4 "") + foo(l4@ "") foo(("")) foo("": Int) foo("": Long) diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ForbiddenNonLocalReturn.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ForbiddenNonLocalReturn.kt index 85b94c9bd5d..9ba5d3c91aa 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ForbiddenNonLocalReturn.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/ForbiddenNonLocalReturn.kt @@ -13,7 +13,7 @@ fun test() { } fun foo() { - val bal = @bag fun () { + val bal = bag@ fun () { val bar = fun() { return@bag } diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt index a3012dac7de..72eb1b423fa 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt @@ -1,10 +1,10 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -val label_fun = @label fun () { +val label_fun = label@ fun () { return@label } -val parenthesized_label_fun = (@label fun () { +val parenthesized_label_fun = (label@ fun () { return@label }) diff --git a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt index 574ecebe3dc..17d3b8ddd79 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt @@ -9,7 +9,7 @@ fun foo(a: A, f: () -> T): T = f() fun foo(b: B, f: () -> T): T = f() fun test(c: C) { - foo(c) @f { + foo(c) f@ { c!! } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt index 84ad92f265a..516d7415f46 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt @@ -1,5 +1,5 @@ val flag = true -val a/*: () -> Comparable*/ = @l { +val a/*: () -> Comparable*/ = l@ { return@l if (flag) "OK" else 4 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElse.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElse.kt index fbc2e169744..a05c2ba1558 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElse.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElse.kt @@ -1,15 +1,15 @@ val flag = true // type of a was checked by txt -val a/*: () -> Any*/ = @l { // commonSupertype(Int, Unit) = Any +val a/*: () -> Any*/ = l@ { // commonSupertype(Int, Unit) = Any if (flag) return@l 4 } -val b/*: () -> Int */ = @l { +val b/*: () -> Int */ = l@ { if (flag) return@l 4 5 } -val c/*: () -> Unit */ = @l { +val c/*: () -> Unit */ = l@ { if (flag) 4 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElseWithExplicitType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElseWithExplicitType.kt index 944f04552c7..278daa46611 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElseWithExplicitType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/IfWithoutElseWithExplicitType.kt @@ -1,22 +1,22 @@ val flag = true -val a: () -> Int = @l { +val a: () -> Int = l@ { if (flag) return@l 4 } -val b: () -> Unit = @l { +val b: () -> Unit = l@ { if (flag) return@l 4 } -val c: () -> Any = @l { +val c: () -> Any = l@ { if (flag) return@l 4 } -val d: () -> Int = @l { +val d: () -> Int = l@ { if (flag) return@l 4 5 } -val e: () -> Int = @l { +val e: () -> Int = l@ { if (flag) 4 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt index 086ad1b5713..777ef9e8a48 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt @@ -1,6 +1,6 @@ val flag = true -val a /*: (Int) -> String */ = @l { +val a /*: (Int) -> String */ = l@ { i: Int -> if (i == 0) return@l i.toString() diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalAndNonLocalReturnInLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalAndNonLocalReturnInLambda.kt index 9a25c953d5b..d09348af221 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalAndNonLocalReturnInLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalAndNonLocalReturnInLambda.kt @@ -1,5 +1,5 @@ fun test2(a: Int) { - val x = run @f{ + val x = run f@{ if (a > 0) return return@f 1 } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt index b004edf6a89..cef4371f341 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt @@ -1,5 +1,5 @@ fun test2() { - val x = run @f{return@f 1} + val x = run f@{return@f 1} x: Int } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt index cb4443cbf70..e341f7f9795 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt @@ -1,11 +1,11 @@ fun test() { - val x = run(@f{return@f 1}) + val x = run(f@{return@f 1}) x: Int } fun test1() { - val x = run(@l{return@l 1}) + val x = run(l@{return@l 1}) x: Int } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt index d2c175f21de..0f50172add9 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnHasTypeNothing.kt @@ -1,5 +1,5 @@ fun test() { - run1 @f{ + run1 f@{ (return@f 1): Nothing } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt index d9add5d633f..ecbeb658bcf 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt @@ -1,5 +1,5 @@ fun test() { - val x = run @f{ + val x = run f@{ fun local(a: Int): String { if (a > 0) return "2" return@local "3" diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt index 1a7bc1c4507..adae2dda1a1 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt @@ -1,6 +1,6 @@ fun test() { - val x = run @f{ - run @ff { + val x = run f@{ + run ff@ { return@ff "2" } return@f 1 diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt index 59a328d0f4f..a78c1afdf9c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNoCoercionToUnit.kt @@ -1,5 +1,5 @@ fun test(a: Int) { - run @f{ + run f@{ if (a > 0) return@f else return@f 1 } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt index 158e5ca0f84..2e9d8675ca3 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt @@ -1,13 +1,13 @@ class A val flag = true -val a /*: () -> A?*/ = @l { +val a /*: () -> A?*/ = l@ { if (flag) return@l null A() } -val b /*: () -> A?*/ = @l { +val b /*: () -> A?*/ = l@ { if (flag) return@l null return@l A() diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnSecondUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnSecondUnit.kt index c3e99267d8c..280e2b42b4e 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnSecondUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnSecondUnit.kt @@ -1,6 +1,6 @@ val flag = true -val a = @b { +val a = b@ { if (flag) return@b 4 return@b } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt index 2cdd68581dd..7190ae4196d 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt @@ -1,5 +1,5 @@ fun test(a: Int) { - val x = run @f{ + val x = run f@{ if (a > 0) return@f else return@f Unit } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitWithBodyExpression.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitWithBodyExpression.kt index ddb57af7c65..2c4627edc27 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitWithBodyExpression.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitWithBodyExpression.kt @@ -1,7 +1,7 @@ val flag = true // type of lambda was checked by txt -val a = @b { // () -> Unit +val a = b@ { // () -> Unit if (flag) return@b else 54 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExpectedType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExpectedType.kt index b07d93ba53c..d5139c44133 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExpectedType.kt @@ -3,7 +3,7 @@ fun listOf(vararg values: T): List = null!! val flag = true -val a: () -> List = @l { +val a: () -> List = l@ { if (flag) return@l listOf() listOf(5) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt index 069ca643919..1c12596f99a 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt @@ -1,16 +1,16 @@ val flag = true // type of lambda was checked by txt -val a = @l { // () -> Any +val a = l@ { // () -> Any if (flag) return@l 4 return@l Unit } -val b = @l { // () -> Any +val b = l@ { // () -> Any if (flag) return@l Unit 5 } -val c = @l { // () -> Unit +val c = l@ { // () -> Unit if (flag) return@l Unit } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt index b6ac6fdb559..3a8749785c7 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnsWithExplicitReturnType.kt @@ -1,5 +1,5 @@ fun test(a: Int) { - run @f{ (): Int -> + run f@{ (): Int -> if (a > 0) return@f "" return@f 1 } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt index ad729ecf83d..dff00a22525 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt @@ -4,7 +4,7 @@ trait C: A fun test(a: C, b: B) { - val x = run @f{ + val x = run f@{ if (a != b) return@f a b } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt index 98345e5619d..58a53681e48 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt @@ -1,6 +1,6 @@ // KT-6822 Smart cast doesn't work inside local returned expression in lambda -val a /* :(Int?) -> Int? */ = @l { it: Int? -> // but must be (Int?) -> Int +val a /* :(Int?) -> Int? */ = l@ { it: Int? -> // but must be (Int?) -> Int if (it != null) return@l it 5 } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCastWithExplicitType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCastWithExplicitType.kt index 549ae9ff68d..6a08a9c651c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCastWithExplicitType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCastWithExplicitType.kt @@ -1,6 +1,6 @@ // KT-6822 Smart cast doesn't work inside local returned expression in lambda -val a : (Int?) -> Int = @l { +val a : (Int?) -> Int = l@ { if (it != null) return@l it 5 } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/unresolvedReferenceInReturnBlock.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/unresolvedReferenceInReturnBlock.kt index fd0595e1932..c553b404621 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/unresolvedReferenceInReturnBlock.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/unresolvedReferenceInReturnBlock.kt @@ -1,8 +1,8 @@ -val a = @l { +val a = l@ { return@l r } -val b = @l { +val b = l@ { if ("" == "OK") return@l return@l r diff --git a/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt b/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt index c96d91ec709..23b8bcf37e6 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/returnNullWithReturn.kt @@ -4,7 +4,7 @@ trait Element fun test(handlers: MapUnit>) { - handlers.getOrElse("name", @l { return@l null }) + handlers.getOrElse("name", l@ { return@l null }) } fun Map.getOrElse(key: K, defaultValue: ()-> V) : V = throw Exception("$key $defaultValue") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/inferInFunctionLiteralsWithReturn.kt b/compiler/testData/diagnostics/tests/inference/inferInFunctionLiteralsWithReturn.kt index 28ce4a098af..6b41c1bc9d8 100644 --- a/compiler/testData/diagnostics/tests/inference/inferInFunctionLiteralsWithReturn.kt +++ b/compiler/testData/diagnostics/tests/inference/inferInFunctionLiteralsWithReturn.kt @@ -6,7 +6,7 @@ import java.util.* fun expected(t: T, f: () -> T) : T = t fun test(arrayList: ArrayList, list: List) { - val t = expected(arrayList, @l {return@l list.reverse() }) + val t = expected(arrayList, l@ {return@l list.reverse() }) } fun List.reverse() : List = this \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/labeled.kt b/compiler/testData/diagnostics/tests/inline/labeled.kt index 0f0847b27e2..283e5b7b18d 100644 --- a/compiler/testData/diagnostics/tests/inline/labeled.kt +++ b/compiler/testData/diagnostics/tests/inline/labeled.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE inline fun foo(bar1: (String.() -> Int) -> Int, bar2: (()->Int) -> Int) { - bar1 @label { + bar1 label@ { this@label.length() } @@ -13,7 +13,7 @@ inline fun foo(bar1: (String.() -> Int) -> Int, bar2: (()->Int) -> Int) { // this@bar1.length //} - bar2 @l { + bar2 l@ { 11 } @@ -24,17 +24,17 @@ inline fun foo(bar1: (String.() -> Int) -> Int, bar2: (()->Int) -> Int) { } inline fun foo2(bar1: (String.() -> Int) -> Int) { - @l1 bar1 + l1@ bar1 - @l2 bar1 { + l2@ bar1 { 11 } - (@l3 bar1) { + (l3@ bar1) { 11 } - (@l5 (@l4 bar1)) { + (l5@ (l4@ bar1)) { 11 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt index df3ddcb01d1..46213c1e049 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt @@ -1,5 +1,5 @@ fun inlineCallExplicitError(): String { - inlineFun @lamba { + inlineFun lamba@ { if (true) { return@lamba 2 } @@ -10,7 +10,7 @@ fun inlineCallExplicitError(): String { } fun inlineCall(): String { - inlineFun @lamba { + inlineFun lamba@ { if (true) { return@lamba 2 } @@ -26,7 +26,7 @@ inline fun inlineFun(s: () -> Int) { fun noInlineCall(): String { - noInline @lambda { + noInline lambda@ { if (true) { return@lambda 2 } diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt index cc40fd4cec1..9f09e8ee266 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt @@ -15,9 +15,9 @@ class Global(val value: String) fun test1(intKind: Kind, extKind: Kind): Global { - var externalResult = doCall @ext { + var externalResult = doCall ext@ { - val internalResult = doCall @int { + val internalResult = doCall int@ { if (intKind == Kind.LOCAL) { return@test1 Global("internal to global") } else if (intKind == EXT_RETURN) { diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt index 106852e74af..98e99ba17f1 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambda.kt @@ -27,13 +27,13 @@ fun fun3ValueArgument(p: () -> R) { fun fun4(p: () -> R) { - inlineFun @lambda { + inlineFun lambda@ { return@lambda p(); } } fun fun4ValueArgument(p: () -> R) { - inlineFun (@lambda { + inlineFun (lambda@ { return@lambda p(); }) } diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt index 3889bf8a453..d6fc9938e25 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/onlyLocalReturnLambdaBinaryExpr.kt @@ -20,7 +20,7 @@ fun fun3(p: () -> R) { } fun fun4(p: () -> R) { - Z() inlineFun @lambda { + Z() inlineFun lambda@ { return@lambda p(); } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/parenthesized.kt b/compiler/testData/diagnostics/tests/inline/parenthesized.kt index bb4e5514ae9..316215cf069 100644 --- a/compiler/testData/diagnostics/tests/inline/parenthesized.kt +++ b/compiler/testData/diagnostics/tests/inline/parenthesized.kt @@ -20,6 +20,6 @@ inline fun inlineFunWithInvoke2(s: (p: Int) -> Unit) { } inline fun propagation(s: (p: Int) -> Unit) { - inlineFunWithInvoke((@label (s: (p: Int) -> Unit))) - inlineFunWithInvoke((@label2 @label (s: (p: Int) -> Unit))) + inlineFunWithInvoke((label@ (s: (p: Int) -> Unit))) + inlineFunWithInvoke((label2@ label@ (s: (p: Int) -> Unit))) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/labels/kt1703.kt b/compiler/testData/diagnostics/tests/labels/kt1703.kt index bdaf03bb6fd..bd0c7591f29 100644 --- a/compiler/testData/diagnostics/tests/labels/kt1703.kt +++ b/compiler/testData/diagnostics/tests/labels/kt1703.kt @@ -5,8 +5,8 @@ public inline fun Array(n: Int, block: (Int) -> T): Array = null! fun test() { val ints = Array(2, { null }) - ints.forEach @lit { - if (it == null) return @lit + ints.forEach lit@ { + if (it == null) return@lit use(it + 5) } } diff --git a/compiler/testData/diagnostics/tests/labels/kt361.kt b/compiler/testData/diagnostics/tests/labels/kt361.kt index 6648d6709fa..621d551b151 100644 --- a/compiler/testData/diagnostics/tests/labels/kt361.kt +++ b/compiler/testData/diagnostics/tests/labels/kt361.kt @@ -1,5 +1,5 @@ fun nonlocals(b : Boolean) { - @a{ + a@{ fun foo() { if (b) { return@a 1 // The label must be resolved, but an error should be reported for a non-local return diff --git a/compiler/testData/diagnostics/tests/labels/kt3920.kt b/compiler/testData/diagnostics/tests/labels/kt3920.kt index f75d16f0c2a..b03544a56c7 100644 --- a/compiler/testData/diagnostics/tests/labels/kt3920.kt +++ b/compiler/testData/diagnostics/tests/labels/kt3920.kt @@ -2,7 +2,7 @@ //KT-3920 Labeling information is lost when passing through some expressions fun test() { - run @f{ + run f@{ val x = if (1 > 2) return@f 1 else 2 2 } diff --git a/compiler/testData/diagnostics/tests/labels/kt4586.kt b/compiler/testData/diagnostics/tests/labels/kt4586.kt index e2d1eb488ff..80ff4c1115b 100644 --- a/compiler/testData/diagnostics/tests/labels/kt4586.kt +++ b/compiler/testData/diagnostics/tests/labels/kt4586.kt @@ -7,7 +7,7 @@ fun string(init: StringBuilder.() -> Unit): String{ return answer.toString() } -val str = string @l{ +val str = string l@{ append("hello, ") val sub = string { diff --git a/compiler/testData/diagnostics/tests/labels/kt4603.kt b/compiler/testData/diagnostics/tests/labels/kt4603.kt index 02bb77420d5..31e6bb298fe 100644 --- a/compiler/testData/diagnostics/tests/labels/kt4603.kt +++ b/compiler/testData/diagnostics/tests/labels/kt4603.kt @@ -2,7 +2,7 @@ //KT-4603 Labeling information is lost when passing through local classes or objects fun foo() { - val s: Int.() -> Unit = @l{ + val s: Int.() -> Unit = l@{ class Local(val y: Int = this@l) { fun bar() { val x: Int = this@l //unresolved diff --git a/compiler/testData/diagnostics/tests/labels/kt591.kt b/compiler/testData/diagnostics/tests/labels/kt591.kt index fdcdc7b4213..60be9fe4960 100644 --- a/compiler/testData/diagnostics/tests/labels/kt591.kt +++ b/compiler/testData/diagnostics/tests/labels/kt591.kt @@ -1,10 +1,10 @@ //KT-591 Unresolved label in valid code fun test() { - val a: (Int?).() -> Unit = @a{ + val a: (Int?).() -> Unit = a@{ if (this != null) { val b: String.() -> Unit = { - this@a.times(5) // @a Unresolved + this@a.times(5) // a@ Unresolved } } } diff --git a/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt b/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt index 14249b42887..1ed711d3d89 100644 --- a/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt +++ b/compiler/testData/diagnostics/tests/labels/labelReferencesInsideObjectExpressions.kt @@ -15,7 +15,7 @@ fun B.b() { } fun test() { - @b { B.() -> + b@ { B.() -> object : A { override fun foo() { this@b.bar() diff --git a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt index 870084d6945..82475c40971 100644 --- a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt +++ b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt @@ -8,8 +8,8 @@ fun main(args : Array) { val h : String = v--; val h1 : String = --v; val i : String = !true; - val j : String = @foo true; - val k : String = @foo @bar true; + val j : String = foo@ true; + val k : String = foo@ bar@ true; val l : String = -1; val m : String = +1; } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt411.kt b/compiler/testData/diagnostics/tests/regressions/kt411.kt index 94416cca637..ae76d1ab5aa 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt411.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt411.kt @@ -4,7 +4,7 @@ package kt411 fun f() { invoker( - @l{ + l@{ return@l 11 // expects Function, but should expect Int } ) @@ -13,13 +13,13 @@ fun invoker(gen : () -> Int) : Int = 0 //more tests fun t1() { - val v = @l{ + val v = l@{ return@l 111 } } fun t2() : String { - val g : ()-> Int = @l{ + val g : ()-> Int = l@{ if (true) { return@l 1 } @@ -30,7 +30,7 @@ fun t2() : String { fun t3() : String { invoker( - @l{ + l@{ if (true) { return@t3 "1" } @@ -41,7 +41,7 @@ fun t3() : String { } ) invoker( - @l{ + l@{ return@l 1 } ) @@ -54,10 +54,10 @@ fun t3() : String { } fun t4() : Int { - val h : ()-> String = @l{ + val h : ()-> String = l@{ return@l "a" } - val g : ()-> String = @l{ + val g : ()-> String = l@{ return@l "a" } diff --git a/compiler/testData/diagnostics/tests/regressions/kt439.kt b/compiler/testData/diagnostics/tests/regressions/kt439.kt index 51fe7b6a134..3ad9171de2a 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt439.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt439.kt @@ -3,5 +3,5 @@ inline fun run1(body : () -> T) : T = body() fun main1(args : Array) { - run1 @l{ 1 } // should not be an error + run1 l@{ 1 } // should not be an error } diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt index 3450ebb9247..9955a39c782 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeUnmappedArguments.kt @@ -1,7 +1,7 @@ package c fun test() { - with (1) @l { + with (1) l@ { foo(1, zz = { this@l } ) } } diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt index 822249e523e..10e8c6099fc 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt @@ -14,7 +14,7 @@ fun test(bar: Bar, a: A) { // no elements with error types fooInt((bar())) fooInt(if (true) bar() else bar()) - fooInt(@label bar()) + fooInt(label@ bar()) fooInt(a.bar()) - fooInt(((@label if (true) (a.bar()) else bar()))) + fooInt(((label@ if (true) (a.bar()) else bar()))) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt b/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt index a72c19c358a..084740d87c0 100644 --- a/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt +++ b/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt @@ -3,7 +3,7 @@ fun testEquals(x: Int) { if (x == (null)) {} if (x == null: Nothing?) {} if (x == null: Nothing?) {} - if (x == @foo null) {} + if (x == foo@ null) {} } fun testEqualsFlipped(x: Int) { @@ -11,7 +11,7 @@ fun testEqualsFlipped(x: Int) { if ((null) == x) {} if (null: Nothing? == x) {} if (null: Nothing? == x) {} - if (@foo null == x) {} + if (foo@ null == x) {} } fun testNotEquals(x: Int) { @@ -19,7 +19,7 @@ fun testNotEquals(x: Int) { if (x != (null)) {} if (x != null: Nothing?) {} if (x != null: Nothing?) {} - if (x != @foo null) {} + if (x != foo@ null) {} } fun testNotEqualsFlipped(x: Int) { @@ -27,5 +27,5 @@ fun testNotEqualsFlipped(x: Int) { if ((null) != x) {} if (null: Nothing? != x) {} if (null: Nothing? != x) {} - if (@foo null != x) {} + if (foo@ null != x) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.kt index 975aa6da12e..d77efc83366 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.kt @@ -1,6 +1,6 @@ public fun foo(x: String?): Int { var y: Any - @loop while (true) { + loop@ while (true) { y = when (x) { null -> break@loop "abc" -> return 0 diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedDoWhileWithLongContinue.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedDoWhileWithLongContinue.kt index 9a124d12905..679917a47fb 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedDoWhileWithLongContinue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedDoWhileWithLongContinue.kt @@ -1,7 +1,7 @@ fun x(): Boolean { return true } public fun foo(p: String?, r: String?): Int { - @outer do { + outer@ do { do { p!!.length() if (!x()) continue@outer diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.kt index 0291528e703..14f8e570c8b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.kt @@ -3,7 +3,7 @@ fun x(p: String): Boolean { return p == "abc" } public fun foo(p: String?, r: String?, q: String?): Int { while(true) { q!!.length() - @loop do { + loop@ do { while(true) { p!!.length() if (x(p)) break@loop diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongContinue.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongContinue.kt index db10ed4a868..1a760a84dc3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongContinue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongContinue.kt @@ -1,7 +1,7 @@ fun x(): Boolean { return true } public fun foo(p: String?, r: String?, q: String?): Int { - @outer while(true) { + outer@ while(true) { q!!.length() do { if (x()) continue@outer diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.kt index e0aad11d31a..ae65a87926c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.kt @@ -3,7 +3,7 @@ fun bar(): Boolean { return true } public fun foo(x: String?): Int { var y: Int? y = 0 - @loop do { + loop@ do { y += when (x) { null -> break@loop "abc" -> return 0 diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.kt index 919e9e50e63..c0d8fc61ccd 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.kt @@ -1,5 +1,5 @@ public fun foo(x: String?): Int { - @loop while (true) { + loop@ while (true) { when (x) { null -> break@loop "abc" -> return 0 diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whenReturnInsideWhileTrue.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whenReturnInsideWhileTrue.kt index 13779dcf763..e801f7c68b7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whenReturnInsideWhileTrue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whenReturnInsideWhileTrue.kt @@ -1,5 +1,5 @@ public fun foo(x: String?): Int { - @loop while (true) { + loop@ while (true) { when (x) { null -> return -1 "abc" -> return 0 diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt b/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt index 55f5725a631..8343fe5ef06 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/thisInFunctionLiterals.kt @@ -8,9 +8,9 @@ class A(val a:Int) { this@B : B this@A : A } - val b: Double.() -> Unit = @a{ this@a : Double + this@xx : Char} - val c = @a{ -> this@a + this@xx : Char} - return (@a{this@a : Double + this@xx : Char}) + val b: Double.() -> Unit = a@{ this@a : Double + this@xx : Char} + val c = a@{ -> this@a + this@xx : Char} + return (a@{this@a : Double + this@xx : Char}) } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt index adb9f975d41..49901df6609 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/dynamicCallsWithLambdas.kt @@ -23,11 +23,11 @@ fun test(d: dynamic) { d.foo({ x -> } : (Int) -> Unit) - d.foo(@label { x -> }) + d.foo(label@ { x -> }) - d.foo(@label ({ x, y -> })) + d.foo(label@ ({ x, y -> })) - d.foo((@label ({ (x, y: Int) -> }))) + d.foo((label@ ({ (x, y: Int) -> }))) d.foo(({ x -> })) diff --git a/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt b/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt index 809e3756236..a97a2cc1341 100644 --- a/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt +++ b/compiler/testData/resolveAnnotations/parameters/expressions/labeled.kt @@ -2,6 +2,6 @@ package test annotation class Ann(i: Double) -Ann(@A 1.0) class MyClass +Ann(A@ 1.0) class MyClass // EXPECTED: Ann(i = 1.0.toDouble(): Double) diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt b/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt index c0c86a5df7a..c73f06f3af1 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/generateTestDataForReservedWords.kt @@ -31,7 +31,7 @@ val commonCases: CaseBuilder.(String, String) -> Unit = { testByName, testByRef $testRenamedByName }""", "foo(\"123\")") - case("label", "val t: Int", " = 0", "testRenamed(\"$KEYWORD_MARKER\", { @$KEYWORD_MARKER while (false) {} })") + case("label", "val t: Int", " = 0", "testRenamed(\"$KEYWORD_MARKER\", { $KEYWORD_MARKER@ while (false) {} })") } val commonCasesWithTestNotRenamed: CaseBuilder.() -> Unit = { commonCases(testNotRenamedByName, testNotRenamedByRef) } diff --git a/idea/idea-completion/testData/keywords/BreakContinue.kt b/idea/idea-completion/testData/keywords/BreakContinue.kt index 16593ad273d..3361179146f 100644 --- a/idea/idea-completion/testData/keywords/BreakContinue.kt +++ b/idea/idea-completion/testData/keywords/BreakContinue.kt @@ -1,9 +1,9 @@ fun foo() { - @myFor + myFor@ for (i in 1..10) { - @myWhile + myWhile@ while (x()) { - @myDo + myDo@ do { } while (y()) diff --git a/idea/idea-completion/testData/keywords/BreakWithLabel.kt b/idea/idea-completion/testData/keywords/BreakWithLabel.kt index 22dfc19a15f..aafd3ed3bc0 100644 --- a/idea/idea-completion/testData/keywords/BreakWithLabel.kt +++ b/idea/idea-completion/testData/keywords/BreakWithLabel.kt @@ -1,9 +1,9 @@ fun foo() { - @myFor + myFor@ for (i in 1..10) { - @myWhile + myWhile@ while (x()) { - @myDo + myDo@ do { break@ } while (y()) diff --git a/idea/idea-completion/testData/keywords/ContinueWithLabel.kt b/idea/idea-completion/testData/keywords/ContinueWithLabel.kt index 280020f8f5e..4907f84514f 100644 --- a/idea/idea-completion/testData/keywords/ContinueWithLabel.kt +++ b/idea/idea-completion/testData/keywords/ContinueWithLabel.kt @@ -1,9 +1,9 @@ fun foo() { - @myFor + myFor@ for (i in 1..10) { - @myWhile + myWhile@ while (x()) { - @myDo + myDo@ do { continue@ } while (y()) diff --git a/idea/idea-completion/testData/keywords/LabeledLambdaThis.kt b/idea/idea-completion/testData/keywords/LabeledLambdaThis.kt index 201f1289ff4..0995a29fd16 100644 --- a/idea/idea-completion/testData/keywords/LabeledLambdaThis.kt +++ b/idea/idea-completion/testData/keywords/LabeledLambdaThis.kt @@ -1,5 +1,5 @@ fun foo(): String.() -> Unit { - return (@label { + return (label@ { f { } diff --git a/idea/idea-completion/testData/keywords/NoBreak1.kt b/idea/idea-completion/testData/keywords/NoBreak1.kt index 304a1f08870..86eb1816347 100644 --- a/idea/idea-completion/testData/keywords/NoBreak1.kt +++ b/idea/idea-completion/testData/keywords/NoBreak1.kt @@ -1,5 +1,5 @@ fun foo() { - @myFor + myFor@ for (i in 1..10) { while (x()) { fun localFun(a: Int) { diff --git a/idea/idea-completion/testData/keywords/NoBreak2.kt b/idea/idea-completion/testData/keywords/NoBreak2.kt index 17132ab5828..4d549a36c66 100644 --- a/idea/idea-completion/testData/keywords/NoBreak2.kt +++ b/idea/idea-completion/testData/keywords/NoBreak2.kt @@ -1,5 +1,5 @@ fun foo() { - @myFor + myFor@ for (i in 1..10) { while (x()) { "abc".filter { diff --git a/idea/idea-completion/testData/keywords/NoContinue.kt b/idea/idea-completion/testData/keywords/NoContinue.kt index 632578c2e97..cc703efb5d6 100644 --- a/idea/idea-completion/testData/keywords/NoContinue.kt +++ b/idea/idea-completion/testData/keywords/NoContinue.kt @@ -1,5 +1,5 @@ fun foo() { - @myFor + myFor@ for (i in 1..10) { while (x()) { fun localFun(a: Int) { diff --git a/idea/idea-completion/testData/keywords/Return4.kt b/idea/idea-completion/testData/keywords/Return4.kt index 9857c5d6ca2..ae5f99603b2 100644 --- a/idea/idea-completion/testData/keywords/Return4.kt +++ b/idea/idea-completion/testData/keywords/Return4.kt @@ -1,5 +1,5 @@ fun foo() { - takeHandler @label { + takeHandler label@ { } } diff --git a/idea/idea-completion/testData/keywords/Return5.kt b/idea/idea-completion/testData/keywords/Return5.kt index 581676113a8..d17625352c4 100644 --- a/idea/idea-completion/testData/keywords/Return5.kt +++ b/idea/idea-completion/testData/keywords/Return5.kt @@ -1,5 +1,5 @@ fun foo() { - takeHandler @label { + takeHandler label@ { } } diff --git a/idea/testData/checker/BreakContinue.kt b/idea/testData/checker/BreakContinue.kt index d5425ecfc64..72fb3085c24 100644 --- a/idea/testData/checker/BreakContinue.kt +++ b/idea/testData/checker/BreakContinue.kt @@ -1,8 +1,8 @@ class C { fun f (a : Boolean, b : Boolean) { - @b (while (true) - @a { + b@ (while (true) + a@ { break@f break break@b @@ -11,8 +11,8 @@ class C { continue - @b (while (true) - @a { + b@ (while (true) + a@ { continue@f continue continue@b diff --git a/idea/testData/checker/FunctionReturnTypes.kt b/idea/testData/checker/FunctionReturnTypes.kt index 3d1e868e272..5f714467e87 100644 --- a/idea/testData/checker/FunctionReturnTypes.kt +++ b/idea/testData/checker/FunctionReturnTypes.kt @@ -6,7 +6,7 @@ fun unitEmptyReturn() : Unit {return} fun unitIntReturn() : Unit {return 1} fun unitUnitReturn() : Unit {return Unit} fun test1() : Any = { return } -fun test2() : Any = @a {return@a 1} +fun test2() : Any = a@ {return@a 1} fun test3() : Any { return } fun bbb() { diff --git a/idea/testData/checker/QualifiedThisInClosures.kt b/idea/testData/checker/QualifiedThisInClosures.kt index b3171d67a4d..8026d631cd9 100644 --- a/idea/testData/checker/QualifiedThisInClosures.kt +++ b/idea/testData/checker/QualifiedThisInClosures.kt @@ -8,9 +8,9 @@ fun Char.xx() : Double.() -> Unit { this : Char val a: Double.() -> Unit = { this : Double + this@xx : Char} - val b: Double.() -> Unit = @a{this@a : Double + this@xx : Char} - val c = @a{this@a + this@xx : Char} - return (@a{this@a : Double + this@xx : Char}) + val b: Double.() -> Unit = a@{this@a : Double + this@xx : Char} + val c = a@{this@a + this@xx : Char} + return (a@{this@a : Double + this@xx : Char}) } } } diff --git a/idea/testData/expressionSelection/labelledStatement.kt b/idea/testData/expressionSelection/labelledStatement.kt index 5f6cecbed51..1d2b0e01264 100644 --- a/idea/testData/expressionSelection/labelledStatement.kt +++ b/idea/testData/expressionSelection/labelledStatement.kt @@ -1,5 +1,5 @@ fun f() { - @loop while (true) { + loop@ while (true) { break@loop } } diff --git a/idea/testData/formatter/ReturnExpression.after.kt b/idea/testData/formatter/ReturnExpression.after.kt index fe2558f66e6..69e627045b6 100644 --- a/idea/testData/formatter/ReturnExpression.after.kt +++ b/idea/testData/formatter/ReturnExpression.after.kt @@ -23,7 +23,7 @@ fun test4(): Int { fun test5(): Int { return synchronized(this) {(): Int -> - return@synchronized 12 + return @synchronized 12 } } diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt index 9baeb9c4c9b..ede85927196 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: true fun foo() { - bar(2) @l{ it * 3 } + bar(2) l@{ it * 3 } } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt.after b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt.after index e582c3be472..49466600a84 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt.after +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda1.kt.after @@ -1,6 +1,6 @@ // IS_APPLICABLE: true fun foo() { - bar(2, @l{ it * 3 }) + bar(2, l@{ it * 3 }) } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt index 051018e7fd7..7d18b2e7896 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: true fun foo() { - bar @l{ it * 3 } + bar l@{ it * 3 } } fun bar(b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt.after b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt.after index 081d675b1c6..8232a82eba6 100644 --- a/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt.after +++ b/idea/testData/intentions/moveLambdaInsideParentheses/moveLabeledLambda2.kt.after @@ -1,6 +1,6 @@ // IS_APPLICABLE: true fun foo() { - bar(@l{ it * 3 }) + bar(l@{ it * 3 }) } fun bar(b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt b/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt index b5aef8a9b38..45a4160ca44 100644 --- a/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt +++ b/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: true fun foo() { - bar(2, @l{ it }) + bar(2, l@{ it }) } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt.after b/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt.after index f50c3e47809..12e81e994a6 100644 --- a/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt.after +++ b/idea/testData/intentions/moveLambdaOutsideParentheses/labeledLambda.kt.after @@ -1,6 +1,6 @@ // IS_APPLICABLE: true fun foo() { - bar(2) @l{ it } + bar(2) l@{ it } } fun bar(a: Int, b: (Int) -> Int) { diff --git a/idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses2.kt b/idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses2.kt index 996f07ea7c0..ad209c263b1 100644 --- a/idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses2.kt +++ b/idea/testData/intentions/removeUnnecessaryParentheses/necessaryParentheses2.kt @@ -1,4 +1,4 @@ // IS_APPLICABLE: false fun foo() : Any { - return (@a{}) + return (a@{}) } \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/afterLambdaInsideLambda.kt b/idea/testData/quickfix/migration/lambdaSyntax/afterLambdaInsideLambda.kt index 55753af2bfd..0d29ab9717a 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/afterLambdaInsideLambda.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/afterLambdaInsideLambda.kt @@ -4,7 +4,7 @@ class A fun foo(a: Any) {} -val a = foo @a { +val a = foo a@ { val a = fun (): Int = 1 } \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgument.kt b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgument.kt index 38b21157826..0ef9a420ef4 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgument.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgument.kt @@ -4,7 +4,7 @@ class A fun foo(a: Int.(String) -> A) {} -val a = foo @a { Int.(a: String): A -> +val a = foo a@ { Int.(a: String): A -> A() A() } \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReceiverType.kt b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReceiverType.kt index f78304f6f41..a7a5b500365 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReceiverType.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReceiverType.kt @@ -4,7 +4,7 @@ class A fun foo(a: Int.(String) -> A) {} -val a = foo @a { (a: String): A -> +val a = foo a@ { (a: String): A -> A() A() } \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReturnType.kt b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReturnType.kt index ac955b98860..7283720e3f8 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReturnType.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentImplicitReturnType.kt @@ -4,7 +4,7 @@ class A fun foo(a: Int.(String) -> A) {} -val a = foo @a { Int.(a: String) -> +val a = foo a@ { Int.(a: String) -> A() A() } \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentOneStatement.kt b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentOneStatement.kt index 8ca1828256b..e2cf5feaf8a 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentOneStatement.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/beforeLabelInLiteralArgumentOneStatement.kt @@ -4,6 +4,6 @@ class A fun foo(a: Any) {} -val a = foo @a { Int.(a: String): A -> +val a = foo a@ { Int.(a: String): A -> A() } \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/beforeLambdaInsideLambda.kt b/idea/testData/quickfix/migration/lambdaSyntax/beforeLambdaInsideLambda.kt index 3d1e81b2a41..141572380f0 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/beforeLambdaInsideLambda.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/beforeLambdaInsideLambda.kt @@ -4,7 +4,7 @@ class A fun foo(a: Any) {} -val a = foo @a { +val a = foo a@ { val a = { (): Int -> 1 } } \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.after.data.Sample.kt b/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.after.data.Sample.kt index 34db40fdd86..54316acc061 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.after.data.Sample.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.after.data.Sample.kt @@ -1,6 +1,6 @@ val h = { -> } -val l = @bar (fun Int.bar() { +val l = bar@ (fun Int.bar() { }) val s = (fun (): Int = 5)() \ No newline at end of file diff --git a/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.before.data.Sample.kt b/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.before.data.Sample.kt index 108243d20ef..3baf83dcda7 100644 --- a/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.before.data.Sample.kt +++ b/idea/testData/quickfix/migration/lambdaSyntax/lambdaSyntaxMultiple.before.data.Sample.kt @@ -1,5 +1,5 @@ val h = { () -> } -val l = @bar { Int.() -> } +val l = bar@ { Int.() -> } val s = {(): Int -> 5}() \ No newline at end of file diff --git a/idea/testData/quickfix/suppress/forStatement/afterLabeled.kt b/idea/testData/quickfix/suppress/forStatement/afterLabeled.kt index d5243aebdbc..44ea0b214bb 100644 --- a/idea/testData/quickfix/suppress/forStatement/afterLabeled.kt +++ b/idea/testData/quickfix/suppress/forStatement/afterLabeled.kt @@ -2,5 +2,5 @@ fun foo() { [suppress("UNNECESSARY_NOT_NULL_ASSERTION")] - @label""!! + label@""!! } \ No newline at end of file diff --git a/idea/testData/quickfix/suppress/forStatement/beforeLabeled.kt b/idea/testData/quickfix/suppress/forStatement/beforeLabeled.kt index 83bbcc23fe6..d086b0b0ab3 100644 --- a/idea/testData/quickfix/suppress/forStatement/beforeLabeled.kt +++ b/idea/testData/quickfix/suppress/forStatement/beforeLabeled.kt @@ -1,5 +1,5 @@ // "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true" fun foo() { - @label""!! + label@""!! } \ No newline at end of file diff --git a/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt b/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt index 2f5f2f30615..e014aa4394c 100644 --- a/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt +++ b/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt @@ -5,8 +5,8 @@ // SIBLING: fun foo(a: Int) { val b: Int = 1 - @loop1 for (p in 1..b) { - @loop2 for (n in 1..b) { + loop1@ for (p in 1..b) { + loop2@ for (n in 1..b) { if (a > 0) throw Exception("") if (a + b > 0) break@loop2 if (a - b > 0) continue@loop1 diff --git a/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt.after b/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt.after index f49703f051f..e173b62a6af 100644 --- a/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt.after +++ b/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/breakContinueAndDefault.kt.after @@ -5,8 +5,8 @@ // SIBLING: fun foo(a: Int) { val b: Int = 1 - @loop1 for (p in 1..b) { - @loop2 for (n in 1..b) { + loop1@ for (p in 1..b) { + loop2@ for (n in 1..b) { if (b(a, b)) break@loop2 } } diff --git a/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/multipleBreaks.kt b/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/multipleBreaks.kt index dcfd5220f11..bf3fbf7e134 100644 --- a/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/multipleBreaks.kt +++ b/idea/testData/refactoring/extractFunction/controlFlow/exitPointEquivalence/multipleBreaks.kt @@ -1,8 +1,8 @@ // SIBLING: fun foo(a: Int) { val b: Int = 1 - @loop1 for (p in 1..b) { - @loop2 for (n in 1..b) { + loop1@ for (p in 1..b) { + loop2@ for (n in 1..b) { if (a > 0) throw Exception("") if (a + b > 0) break@loop1 println(a - b) diff --git a/idea/testData/resolve/partialBodyResolve/LabeledBreak.dump b/idea/testData/resolve/partialBodyResolve/LabeledBreak.dump index 4e8e3545de0..27719f2ec39 100644 --- a/idea/testData/resolve/partialBodyResolve/LabeledBreak.dump +++ b/idea/testData/resolve/partialBodyResolve/LabeledBreak.dump @@ -1,7 +1,7 @@ Resolve target: val x: kotlin.Any? ---------------------------------------------- fun foo() { - @MainLoop + MainLoop@ for (i in 1..10) { val x = take() if (x == null) { diff --git a/idea/testData/resolve/partialBodyResolve/LabeledBreak.kt b/idea/testData/resolve/partialBodyResolve/LabeledBreak.kt index f34bab64fab..7a2105679ab 100644 --- a/idea/testData/resolve/partialBodyResolve/LabeledBreak.kt +++ b/idea/testData/resolve/partialBodyResolve/LabeledBreak.kt @@ -1,5 +1,5 @@ fun foo() { - @MainLoop + MainLoop@ for (i in 1..10) { val x = take() if (x == null) { diff --git a/idea/testData/resolve/partialBodyResolve/LabeledContinue.dump b/idea/testData/resolve/partialBodyResolve/LabeledContinue.dump index 40294362343..66c1b950301 100644 --- a/idea/testData/resolve/partialBodyResolve/LabeledContinue.dump +++ b/idea/testData/resolve/partialBodyResolve/LabeledContinue.dump @@ -1,7 +1,7 @@ Resolve target: val x: kotlin.Any? ---------------------------------------------- fun foo() { - @MainLoop + MainLoop@ for (i in 1..10) { val x = take() if (x == null) { diff --git a/idea/testData/resolve/partialBodyResolve/LabeledContinue.kt b/idea/testData/resolve/partialBodyResolve/LabeledContinue.kt index d90e455846f..12b94d3b210 100644 --- a/idea/testData/resolve/partialBodyResolve/LabeledContinue.kt +++ b/idea/testData/resolve/partialBodyResolve/LabeledContinue.kt @@ -1,5 +1,5 @@ fun foo() { - @MainLoop + MainLoop@ for (i in 1..10) { val x = take() if (x == null) { diff --git a/idea/testData/resolve/references/invoke/lambdaNoParLabel.kt b/idea/testData/resolve/references/invoke/lambdaNoParLabel.kt index 53a2d70ddc0..53c12bb9159 100644 --- a/idea/testData/resolve/references/invoke/lambdaNoParLabel.kt +++ b/idea/testData/resolve/references/invoke/lambdaNoParLabel.kt @@ -3,7 +3,7 @@ class Foo { } fun test(f: Foo) { - f @f {} + f f@ {} } // REF: (in Foo).invoke(Any) \ No newline at end of file diff --git a/idea/testData/smartSelection/labelledStatement.kt b/idea/testData/smartSelection/labelledStatement.kt index ff436e1ce45..a70e40f816b 100644 --- a/idea/testData/smartSelection/labelledStatement.kt +++ b/idea/testData/smartSelection/labelledStatement.kt @@ -1,5 +1,5 @@ fun f() { - @loop while (true) { + loop@ while (true) { break@loop } } diff --git a/idea/testData/unifier/equivalence/controlStructures/break.kt b/idea/testData/unifier/equivalence/controlStructures/break.kt index af795f938b1..286758964ed 100644 --- a/idea/testData/unifier/equivalence/controlStructures/break.kt +++ b/idea/testData/unifier/equivalence/controlStructures/break.kt @@ -1,13 +1,13 @@ fun foo(a: Int) { - @A + A@ while (true) { - @B + B@ while (true) { if (a > 0) break@A if (a < 0) break@B } - @B + B@ while (true) { if (a > 0) break@A if (a < 0) break@B diff --git a/idea/testData/unifier/equivalence/controlStructures/continue.kt b/idea/testData/unifier/equivalence/controlStructures/continue.kt index dc1a5f53ae6..eb091118bf7 100644 --- a/idea/testData/unifier/equivalence/controlStructures/continue.kt +++ b/idea/testData/unifier/equivalence/controlStructures/continue.kt @@ -1,13 +1,13 @@ fun foo(a: Int) { - @A + A@ while (true) { - @B + B@ while (true) { if (a > 0) continue@A if (a < 0) continue@B } - @B + B@ while (true) { if (a > 0) continue@A if (a < 0) continue@B diff --git a/j2k/testData/fileOrElement/for/withContinueAndLabels.kt b/j2k/testData/fileOrElement/for/withContinueAndLabels.kt index 9e9816d3640..73e9653632e 100644 --- a/j2k/testData/fileOrElement/for/withContinueAndLabels.kt +++ b/j2k/testData/fileOrElement/for/withContinueAndLabels.kt @@ -2,9 +2,9 @@ public object TestClass { public fun main(args: Array) { var i = 1 - @OuterLoop1 @OuterLoop2 while (i < 1000) { + OuterLoop1@ OuterLoop2@ while (i < 1000) { var j = 1 - @InnerLoop while (j < 100) { + InnerLoop@ while (j < 100) { if (j == 3) { j *= 3 continue@InnerLoop diff --git a/j2k/testData/fileOrElement/labelStatement/complicatedExampleFromJavaTutorial.kt b/j2k/testData/fileOrElement/labelStatement/complicatedExampleFromJavaTutorial.kt index 2bfa2530e14..b702f29e43c 100644 --- a/j2k/testData/fileOrElement/labelStatement/complicatedExampleFromJavaTutorial.kt +++ b/j2k/testData/fileOrElement/labelStatement/complicatedExampleFromJavaTutorial.kt @@ -1,4 +1,4 @@ -@test for (i in 0..max) { +test@ for (i in 0..max) { var n = substring.length() var j = i var k = 0 diff --git a/j2k/testData/fileOrElement/switch/continueAndBreakWithLabel.kt b/j2k/testData/fileOrElement/switch/continueAndBreakWithLabel.kt index 7bd3d7928e8..d76b7777695 100644 --- a/j2k/testData/fileOrElement/switch/continueAndBreakWithLabel.kt +++ b/j2k/testData/fileOrElement/switch/continueAndBreakWithLabel.kt @@ -1,5 +1,5 @@ fun foo() { - @Loop while (true) { + Loop@ while (true) { when (take()) { 1 -> continue 2 -> { diff --git a/js/js.translator/testData/expression/for/cases/labeledFor.kt b/js/js.translator/testData/expression/for/cases/labeledFor.kt index 1d08104a680..45e8d55028e 100644 --- a/js/js.translator/testData/expression/for/cases/labeledFor.kt +++ b/js/js.translator/testData/expression/for/cases/labeledFor.kt @@ -4,9 +4,9 @@ val a1 = arrayOfNulls(0) fun box(): Boolean { var bar = 33 - @outer for (a in array(1, 2)) { + outer@ for (a in array(1, 2)) { for (b in array(1, 4)) { - break @outer + break@outer } bar = 42 } diff --git a/js/js.translator/testData/expression/for/cases/labeledForWithContinue.kt b/js/js.translator/testData/expression/for/cases/labeledForWithContinue.kt index d136d748c29..d3c73f4c754 100644 --- a/js/js.translator/testData/expression/for/cases/labeledForWithContinue.kt +++ b/js/js.translator/testData/expression/for/cases/labeledForWithContinue.kt @@ -12,23 +12,23 @@ fun up(s: String, value: Int): Int { fun box(): String { - @list + list@ for (i in 0..up("A", 5)) { - continue @list + continue@list } assertEquals("A", global) global = "" - @list1 + list1@ for (i in up("A", 0)..try { global += "B"; 5} finally {}) { - continue @list1 + continue@list1 } assertEquals("AB", global) global = "" - @list2 + list2@ for (i in try { up("A", 0) } finally {}..try { global += "B"; 5} finally {}) { - continue @list2 + continue@list2 } assertEquals("AB", global) diff --git a/js/js.translator/testData/expression/for/cases/labeledForWithWhile.kt b/js/js.translator/testData/expression/for/cases/labeledForWithWhile.kt index 38d53130a53..3f28dcee19c 100644 --- a/js/js.translator/testData/expression/for/cases/labeledForWithWhile.kt +++ b/js/js.translator/testData/expression/for/cases/labeledForWithWhile.kt @@ -2,9 +2,9 @@ package foo fun box(): String { var n = 0 - @forLabel0 for(i in 0..10) { + forLabel0@ for(i in 0..10) { var j = 0 - @whileLabel0 while(j++ { result = true; break@loop } else -> result = false diff --git a/js/js.translator/testData/expression/while/cases/doWhileWithComplexConditionAndContinue.kt b/js/js.translator/testData/expression/while/cases/doWhileWithComplexConditionAndContinue.kt index 04374791c7d..8d3da086ab3 100644 --- a/js/js.translator/testData/expression/while/cases/doWhileWithComplexConditionAndContinue.kt +++ b/js/js.translator/testData/expression/while/cases/doWhileWithComplexConditionAndContinue.kt @@ -17,7 +17,7 @@ fun box(): String { i = 0 global = "" - @labelA do { + labelA@ do { if (i<3) {i++; continue@labelA} break } while(try { global += "A"; i } finally {} < 10) @@ -27,7 +27,7 @@ fun box(): String { i = 0 var j = 0 global = "" - @outer do { + outer@ do { j = 0 while( try {global += "B"; j++ } finally {} < 2) { if (j==1) continue@outer diff --git a/js/js.translator/testData/expression/while/cases/whileWithComplexConditionAndContinue.kt b/js/js.translator/testData/expression/while/cases/whileWithComplexConditionAndContinue.kt index 8c7adb1d13e..ec11fcd43a4 100644 --- a/js/js.translator/testData/expression/while/cases/whileWithComplexConditionAndContinue.kt +++ b/js/js.translator/testData/expression/while/cases/whileWithComplexConditionAndContinue.kt @@ -17,7 +17,7 @@ fun box(): String { i = 0 global = "" - @labelA while(try { global += "A"; i } finally {} < 10) { + labelA@ while(try { global += "A"; i } finally {} < 10) { if (i<3) {i++; continue@labelA} break } @@ -27,7 +27,7 @@ fun box(): String { i = 0 var j = 0 global = "" - @outer while(try { global += "A"; i++ } finally {} < 3) { + outer@ while(try { global += "A"; i++ } finally {} < 3) { j = 0 while( try {global += "B"; j++ } finally {} < 2) { if (j==1) continue@outer diff --git a/js/js.translator/testData/jsCode/cases/labelNestedClashWithKotlin.kt b/js/js.translator/testData/jsCode/cases/labelNestedClashWithKotlin.kt index eeee2efdb35..6cfe2d57b30 100644 --- a/js/js.translator/testData/jsCode/cases/labelNestedClashWithKotlin.kt +++ b/js/js.translator/testData/jsCode/cases/labelNestedClashWithKotlin.kt @@ -10,7 +10,7 @@ fun box(): String { val skipOuter = 8 - @block for (i in range) { + block@ for (i in range) { sum += i if (i == skipOuter) break@block diff --git a/js/js.translator/testData/labels/cases/labelOnExpression.kt b/js/js.translator/testData/labels/cases/labelOnExpression.kt index ed8e4482c08..80d120c5c07 100644 --- a/js/js.translator/testData/labels/cases/labelOnExpression.kt +++ b/js/js.translator/testData/labels/cases/labelOnExpression.kt @@ -8,24 +8,24 @@ package foo fun myRun(f: () -> R) = f() fun test0() { - val a = @aa 1 + val a = aa@ 1 assertEquals(1, a) - assertEquals(3, @l1 a + @l2 2) + assertEquals(3, l1@ a + l2@ 2) - val b = @bb if (true) @t "then block" else @e "else block" + val b = bb@ if (true) t@ "then block" else e@ "else block" assertEquals("then block", b) } fun test1() { - run @label { + run label@ { return@label false } } fun test2() { - myRun @label { + myRun label@ { return@label false } } @@ -33,7 +33,7 @@ fun test2() { // KT-7487 public fun test3() { val f = Foo() - f.iter @label { + f.iter label@ { return@label false } } diff --git a/js/js.translator/testData/labels/cases/labelWithVariableClashing.kt b/js/js.translator/testData/labels/cases/labelWithVariableClashing.kt index 8dfafe434cd..6bd96ac053b 100644 --- a/js/js.translator/testData/labels/cases/labelWithVariableClashing.kt +++ b/js/js.translator/testData/labels/cases/labelWithVariableClashing.kt @@ -6,7 +6,7 @@ package foo fun test1() { var `loop$` = 0 - @loop for (i in 1..10) { + loop@ for (i in 1..10) { `loop$` = i if (i == 5) break@loop } @@ -17,7 +17,7 @@ fun test1() { fun test2() { var loop = 0 - @loop for (i in 1..10) { + loop@ for (i in 1..10) { loop = i if (i == 5) break@loop } diff --git a/js/js.translator/testData/labels/cases/nestedLabels.kt b/js/js.translator/testData/labels/cases/nestedLabels.kt index 8076dff9e17..4061bdc6f17 100644 --- a/js/js.translator/testData/labels/cases/nestedLabels.kt +++ b/js/js.translator/testData/labels/cases/nestedLabels.kt @@ -7,13 +7,13 @@ fun test() { var i = 0 var j = 0 - @loop for (k in 1..10) { - @loop for (m in 1..10) { - if (m == 4) break @loop + loop@ for (k in 1..10) { + loop@ for (m in 1..10) { + if (m == 4) break@loop j = m } - if (k == 8) break @loop + if (k == 8) break@loop i = k } diff --git a/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashing.kt b/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashing.kt index 448f337fe40..491ad92d373 100644 --- a/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashing.kt +++ b/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashing.kt @@ -10,21 +10,21 @@ class State() { } inline fun test1(state: State) { - @loop for (i in 1..10) { + loop@ for (i in 1..10) { state.value++ if (i == 2) break@loop } } inline fun test2(state: State) { - @loop for (i in 1..10) { + loop@ for (i in 1..10) { test1(state) if (i == 2) break@loop } } inline fun test3(state: State) { - @loop for (i in 1..10) { + loop@ for (i in 1..10) { test2(state) if (i == 2) break@loop } diff --git a/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt b/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt index 6a9241a1f99..a543e09b6db 100644 --- a/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt +++ b/js/js.translator/testData/labels/cases/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt @@ -12,19 +12,19 @@ noinline fun test(state: State) { [inline] fun test3() { [inline] fun test2() { [inline] fun test1() { - @loop for (i in 1..10) { + loop@ for (i in 1..10) { state.value++ if (i == 2) break@loop } } - @loop for (i in 1..10) { + loop@ for (i in 1..10) { test1() if (i == 2) break@loop } } - @loop for (i in 1..10) { + loop@ for (i in 1..10) { test2() if (i == 2) break@loop } diff --git a/js/js.translator/testData/labels/cases/siblingLabels.kt b/js/js.translator/testData/labels/cases/siblingLabels.kt index e9464613db3..60f52a4f89b 100644 --- a/js/js.translator/testData/labels/cases/siblingLabels.kt +++ b/js/js.translator/testData/labels/cases/siblingLabels.kt @@ -6,13 +6,13 @@ fun test() { var i = 0 var j = 0 - @loop for (m in 1..10) { - if (m == 4) break @loop + loop@ for (m in 1..10) { + if (m == 4) break@loop j = m } - @loop for (k in 1..10) { - if (k == 4) break @loop + loop@ for (k in 1..10) { + if (k == 4) break@loop i = k } diff --git a/js/js.translator/testData/labels/cases/siblingLabelsInlined.kt b/js/js.translator/testData/labels/cases/siblingLabelsInlined.kt index e885f019062..25aea83e1a8 100644 --- a/js/js.translator/testData/labels/cases/siblingLabelsInlined.kt +++ b/js/js.translator/testData/labels/cases/siblingLabelsInlined.kt @@ -6,13 +6,13 @@ package foo inline fun testInline(): Int { var c = 0 - @loop for (i in 1..9) { + loop@ for (i in 1..9) { c++ if (c == 2) break@loop } - @loop for (j in 1..9) { + loop@ for (j in 1..9) { c++ if (c == 4) break@loop } diff --git a/js/js.translator/testData/labels/cases/siblingLabelsInlinedClashing.kt b/js/js.translator/testData/labels/cases/siblingLabelsInlinedClashing.kt index 92c2173a173..da976d68216 100644 --- a/js/js.translator/testData/labels/cases/siblingLabelsInlinedClashing.kt +++ b/js/js.translator/testData/labels/cases/siblingLabelsInlinedClashing.kt @@ -7,7 +7,7 @@ package foo inline fun testLabelInline(): Int { var a = 0 - @loop for (i in 1..10) { + loop@ for (i in 1..10) { if (i == 1) continue@loop a += i @@ -15,7 +15,7 @@ inline fun testLabelInline(): Int { if (i == 2) break@loop } - @loop for (i in 1..10) { + loop@ for (i in 1..10) { if (i == 1) continue@loop a += i @@ -29,7 +29,7 @@ inline fun testLabelInline(): Int { fun testLabel(): String { var a = 0 - @loop for (i in 1..10) { + loop@ for (i in 1..10) { if (i == 1) continue@loop a += testLabelInline() diff --git a/js/js.translator/testData/labels/cases/simpleLabel.kt b/js/js.translator/testData/labels/cases/simpleLabel.kt index 3d589ba6ae8..c91d5549f63 100644 --- a/js/js.translator/testData/labels/cases/simpleLabel.kt +++ b/js/js.translator/testData/labels/cases/simpleLabel.kt @@ -6,8 +6,8 @@ package foo fun testBreak() { var i = 0 - @loop for (j in 1..10) { - if (j == 5) break @loop + loop@ for (j in 1..10) { + if (j == 5) break@loop i = j } @@ -18,8 +18,8 @@ fun testBreak() { fun testContinue() { var sum = 0 - @loop for (j in 1..5) { - if (j % 2 != 0) continue @loop + loop@ for (j in 1..5) { + if (j % 2 != 0) continue@loop sum += j } diff --git a/js/js.translator/testData/labels/cases/simpleLabelInlined.kt b/js/js.translator/testData/labels/cases/simpleLabelInlined.kt index 6b176d48452..218712b478d 100644 --- a/js/js.translator/testData/labels/cases/simpleLabelInlined.kt +++ b/js/js.translator/testData/labels/cases/simpleLabelInlined.kt @@ -8,8 +8,8 @@ package foo inline fun testBreak(): Int { var i = 0 - @loop for (j in 1..10) { - if (j == 5) break @loop + loop@ for (j in 1..10) { + if (j == 5) break@loop i = j } @@ -24,8 +24,8 @@ noinline fun testBreakNoinline() { inline fun testContinue(): Int { var sum = 0 - @loop for (j in 1..5) { - if (j % 2 != 0) continue @loop + loop@ for (j in 1..5) { + if (j % 2 != 0) continue@loop sum += j } diff --git a/js/js.translator/testData/reservedWords/cases/delegatedLabelDebugger.kt b/js/js.translator/testData/reservedWords/cases/delegatedLabelDebugger.kt index 660d19a6689..cf25bcd7466 100644 --- a/js/js.translator/testData/reservedWords/cases/delegatedLabelDebugger.kt +++ b/js/js.translator/testData/reservedWords/cases/delegatedLabelDebugger.kt @@ -12,7 +12,7 @@ class TraitImpl : Trait { class TestDelegate : Trait by TraitImpl() { fun test() { - testRenamed("debugger", { @debugger while (false) {} }) + testRenamed("debugger", { debugger@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/delegatedLabelDefault.kt b/js/js.translator/testData/reservedWords/cases/delegatedLabelDefault.kt index 568ee47ef3c..5ccc8e2b742 100644 --- a/js/js.translator/testData/reservedWords/cases/delegatedLabelDefault.kt +++ b/js/js.translator/testData/reservedWords/cases/delegatedLabelDefault.kt @@ -12,7 +12,7 @@ class TraitImpl : Trait { class TestDelegate : Trait by TraitImpl() { fun test() { - testRenamed("default", { @default while (false) {} }) + testRenamed("default", { default@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/delegatedLabelVar.kt b/js/js.translator/testData/reservedWords/cases/delegatedLabelVar.kt index 24a2db3086d..09f83ad09d1 100644 --- a/js/js.translator/testData/reservedWords/cases/delegatedLabelVar.kt +++ b/js/js.translator/testData/reservedWords/cases/delegatedLabelVar.kt @@ -12,7 +12,7 @@ class TraitImpl : Trait { class TestDelegate : Trait by TraitImpl() { fun test() { - testRenamed("var", { @`var` while (false) {} }) + testRenamed("var", { `var`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/delegatedLabelWhile.kt b/js/js.translator/testData/reservedWords/cases/delegatedLabelWhile.kt index 5972ca5ddba..09c70081d48 100644 --- a/js/js.translator/testData/reservedWords/cases/delegatedLabelWhile.kt +++ b/js/js.translator/testData/reservedWords/cases/delegatedLabelWhile.kt @@ -12,7 +12,7 @@ class TraitImpl : Trait { class TestDelegate : Trait by TraitImpl() { fun test() { - testRenamed("while", { @`while` while (false) {} }) + testRenamed("while", { `while`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/enumLabelImport.kt b/js/js.translator/testData/reservedWords/cases/enumLabelImport.kt index a1cc49647d1..19b77ea4214 100644 --- a/js/js.translator/testData/reservedWords/cases/enumLabelImport.kt +++ b/js/js.translator/testData/reservedWords/cases/enumLabelImport.kt @@ -7,7 +7,7 @@ enum class Foo { val t: Int = 0 fun test() { - testRenamed("import", { @import while (false) {} }) + testRenamed("import", { import@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/enumLabelIn.kt b/js/js.translator/testData/reservedWords/cases/enumLabelIn.kt index acb5c409c86..0a2ba54cf14 100644 --- a/js/js.translator/testData/reservedWords/cases/enumLabelIn.kt +++ b/js/js.translator/testData/reservedWords/cases/enumLabelIn.kt @@ -7,7 +7,7 @@ enum class Foo { val t: Int = 0 fun test() { - testRenamed("in", { @`in` while (false) {} }) + testRenamed("in", { `in`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/enumLabelInstanceof.kt b/js/js.translator/testData/reservedWords/cases/enumLabelInstanceof.kt index caa38dfc0d9..16bf3e2f536 100644 --- a/js/js.translator/testData/reservedWords/cases/enumLabelInstanceof.kt +++ b/js/js.translator/testData/reservedWords/cases/enumLabelInstanceof.kt @@ -7,7 +7,7 @@ enum class Foo { val t: Int = 0 fun test() { - testRenamed("instanceof", { @instanceof while (false) {} }) + testRenamed("instanceof", { instanceof@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/enumLabelNull.kt b/js/js.translator/testData/reservedWords/cases/enumLabelNull.kt index 7b2473230a2..acab929106f 100644 --- a/js/js.translator/testData/reservedWords/cases/enumLabelNull.kt +++ b/js/js.translator/testData/reservedWords/cases/enumLabelNull.kt @@ -7,7 +7,7 @@ enum class Foo { val t: Int = 0 fun test() { - testRenamed("null", { @`null` while (false) {} }) + testRenamed("null", { `null`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassLabelBreak.kt b/js/js.translator/testData/reservedWords/cases/insideClassLabelBreak.kt index 29dfc7896f4..14cec380e77 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassLabelBreak.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassLabelBreak.kt @@ -6,7 +6,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("break", { @`break` while (false) {} }) + testRenamed("break", { `break`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassLabelCase.kt b/js/js.translator/testData/reservedWords/cases/insideClassLabelCase.kt index 4344f876531..e5db60d5e4b 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassLabelCase.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassLabelCase.kt @@ -6,7 +6,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("case", { @case while (false) {} }) + testRenamed("case", { case@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassLabelCatch.kt b/js/js.translator/testData/reservedWords/cases/insideClassLabelCatch.kt index 79aa1e1dc46..11124b5ff40 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassLabelCatch.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassLabelCatch.kt @@ -6,7 +6,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("catch", { @catch while (false) {} }) + testRenamed("catch", { catch@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassLabelClass.kt b/js/js.translator/testData/reservedWords/cases/insideClassLabelClass.kt index b52264cff99..528fa6807c9 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassLabelClass.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassLabelClass.kt @@ -6,7 +6,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("class", { @`class` while (false) {} }) + testRenamed("class", { `class`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFinally.kt b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFinally.kt index c623d76d529..b80080be324 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFinally.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFinally.kt @@ -7,7 +7,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("finally", { @finally while (false) {} }) + testRenamed("finally", { finally@ while (false) {} }) } } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFunction.kt b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFunction.kt index 161604032d0..b65d91d2116 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFunction.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelFunction.kt @@ -7,7 +7,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("function", { @function while (false) {} }) + testRenamed("function", { function@ while (false) {} }) } } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelPackage.kt b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelPackage.kt index 9827f672947..bd89b7430f1 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelPackage.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelPackage.kt @@ -7,7 +7,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("package", { @`package` while (false) {} }) + testRenamed("package", { `package`@ while (false) {} }) } } } diff --git a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelReturn.kt b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelReturn.kt index af75150bc48..2eebdb3fc68 100644 --- a/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelReturn.kt +++ b/js/js.translator/testData/reservedWords/cases/insideClassObjectLabelReturn.kt @@ -7,7 +7,7 @@ class TestClass { val t: Int = 0 fun test() { - testRenamed("return", { @`return` while (false) {} }) + testRenamed("return", { `return`@ while (false) {} }) } } } diff --git a/js/js.translator/testData/reservedWords/cases/insideObjectLabelClass.kt b/js/js.translator/testData/reservedWords/cases/insideObjectLabelClass.kt index 5f7c916d421..00074a1a917 100644 --- a/js/js.translator/testData/reservedWords/cases/insideObjectLabelClass.kt +++ b/js/js.translator/testData/reservedWords/cases/insideObjectLabelClass.kt @@ -6,7 +6,7 @@ object TestObject { val t: Int = 0 fun test() { - testRenamed("class", { @`class` while (false) {} }) + testRenamed("class", { `class`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideObjectLabelContinue.kt b/js/js.translator/testData/reservedWords/cases/insideObjectLabelContinue.kt index 82182a4dd21..8b238d9421a 100644 --- a/js/js.translator/testData/reservedWords/cases/insideObjectLabelContinue.kt +++ b/js/js.translator/testData/reservedWords/cases/insideObjectLabelContinue.kt @@ -6,7 +6,7 @@ object TestObject { val t: Int = 0 fun test() { - testRenamed("continue", { @`continue` while (false) {} }) + testRenamed("continue", { `continue`@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideObjectLabelPublic.kt b/js/js.translator/testData/reservedWords/cases/insideObjectLabelPublic.kt index 4df282ff00d..ba996d6d52e 100644 --- a/js/js.translator/testData/reservedWords/cases/insideObjectLabelPublic.kt +++ b/js/js.translator/testData/reservedWords/cases/insideObjectLabelPublic.kt @@ -6,7 +6,7 @@ object TestObject { val t: Int = 0 fun test() { - testRenamed("public", { @public while (false) {} }) + testRenamed("public", { public@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/insideObjectLabelStatic.kt b/js/js.translator/testData/reservedWords/cases/insideObjectLabelStatic.kt index 05d35e3bcc9..75e960fdd42 100644 --- a/js/js.translator/testData/reservedWords/cases/insideObjectLabelStatic.kt +++ b/js/js.translator/testData/reservedWords/cases/insideObjectLabelStatic.kt @@ -6,7 +6,7 @@ object TestObject { val t: Int = 0 fun test() { - testRenamed("static", { @static while (false) {} }) + testRenamed("static", { static@ while (false) {} }) } } diff --git a/js/js.translator/testData/reservedWords/cases/localLabelIf.kt b/js/js.translator/testData/reservedWords/cases/localLabelIf.kt index 61d54a5580f..4f19cbaac5a 100644 --- a/js/js.translator/testData/reservedWords/cases/localLabelIf.kt +++ b/js/js.translator/testData/reservedWords/cases/localLabelIf.kt @@ -5,7 +5,7 @@ package foo fun box(): String { val t: Int = 0 - testRenamed("if", { @`if` while (false) {} }) + testRenamed("if", { `if`@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/reservedWords/cases/localLabelIn.kt b/js/js.translator/testData/reservedWords/cases/localLabelIn.kt index bed5f342576..07478db9427 100644 --- a/js/js.translator/testData/reservedWords/cases/localLabelIn.kt +++ b/js/js.translator/testData/reservedWords/cases/localLabelIn.kt @@ -5,7 +5,7 @@ package foo fun box(): String { val t: Int = 0 - testRenamed("in", { @`in` while (false) {} }) + testRenamed("in", { `in`@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/reservedWords/cases/localLabelStatic.kt b/js/js.translator/testData/reservedWords/cases/localLabelStatic.kt index 86431eb4327..b11da005a8c 100644 --- a/js/js.translator/testData/reservedWords/cases/localLabelStatic.kt +++ b/js/js.translator/testData/reservedWords/cases/localLabelStatic.kt @@ -5,7 +5,7 @@ package foo fun box(): String { val t: Int = 0 - testRenamed("static", { @static while (false) {} }) + testRenamed("static", { static@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/reservedWords/cases/localLabelSwitch.kt b/js/js.translator/testData/reservedWords/cases/localLabelSwitch.kt index 90ae72baf9c..244325b3ec6 100644 --- a/js/js.translator/testData/reservedWords/cases/localLabelSwitch.kt +++ b/js/js.translator/testData/reservedWords/cases/localLabelSwitch.kt @@ -5,7 +5,7 @@ package foo fun box(): String { val t: Int = 0 - testRenamed("switch", { @switch while (false) {} }) + testRenamed("switch", { switch@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/reservedWords/cases/toplevelLabelDebugger.kt b/js/js.translator/testData/reservedWords/cases/toplevelLabelDebugger.kt index 5790a1e4e14..b7bad20c09d 100644 --- a/js/js.translator/testData/reservedWords/cases/toplevelLabelDebugger.kt +++ b/js/js.translator/testData/reservedWords/cases/toplevelLabelDebugger.kt @@ -5,7 +5,7 @@ package foo val t: Int = 0 fun box(): String { - testRenamed("debugger", { @debugger while (false) {} }) + testRenamed("debugger", { debugger@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/reservedWords/cases/toplevelLabelDefault.kt b/js/js.translator/testData/reservedWords/cases/toplevelLabelDefault.kt index 0344114c2b2..f3a08256e24 100644 --- a/js/js.translator/testData/reservedWords/cases/toplevelLabelDefault.kt +++ b/js/js.translator/testData/reservedWords/cases/toplevelLabelDefault.kt @@ -5,7 +5,7 @@ package foo val t: Int = 0 fun box(): String { - testRenamed("default", { @default while (false) {} }) + testRenamed("default", { default@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/reservedWords/cases/toplevelLabelIn.kt b/js/js.translator/testData/reservedWords/cases/toplevelLabelIn.kt index 192434e14bf..2e96a7866e8 100644 --- a/js/js.translator/testData/reservedWords/cases/toplevelLabelIn.kt +++ b/js/js.translator/testData/reservedWords/cases/toplevelLabelIn.kt @@ -5,7 +5,7 @@ package foo val t: Int = 0 fun box(): String { - testRenamed("in", { @`in` while (false) {} }) + testRenamed("in", { `in`@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/reservedWords/cases/toplevelLabelNull.kt b/js/js.translator/testData/reservedWords/cases/toplevelLabelNull.kt index 786e5221b03..24d922a795b 100644 --- a/js/js.translator/testData/reservedWords/cases/toplevelLabelNull.kt +++ b/js/js.translator/testData/reservedWords/cases/toplevelLabelNull.kt @@ -5,7 +5,7 @@ package foo val t: Int = 0 fun box(): String { - testRenamed("null", { @`null` while (false) {} }) + testRenamed("null", { `null`@ while (false) {} }) return "OK" } \ No newline at end of file diff --git a/js/js.translator/testData/webDemoCanvasExamples/cases/Creatures.kt b/js/js.translator/testData/webDemoCanvasExamples/cases/Creatures.kt index 38657e33326..ffaa13d89a5 100644 --- a/js/js.translator/testData/webDemoCanvasExamples/cases/Creatures.kt +++ b/js/js.translator/testData/webDemoCanvasExamples/cases/Creatures.kt @@ -241,7 +241,7 @@ class CanvasState(val canvas: HTMLCanvasElement) { } jq(canvas).dblclick { - val newCreature = Creature(mousePos(it), this @CanvasState) + val newCreature = Creature(mousePos(it), this@CanvasState) addShape(newCreature) valid = false } diff --git a/js/js.translator/testData/webDemoCanvasExamples/cases/Traffic light.kt b/js/js.translator/testData/webDemoCanvasExamples/cases/Traffic light.kt index b61647ed32e..b57909e8244 100644 --- a/js/js.translator/testData/webDemoCanvasExamples/cases/Traffic light.kt +++ b/js/js.translator/testData/webDemoCanvasExamples/cases/Traffic light.kt @@ -381,7 +381,7 @@ class CanvasState(val canvas: HTMLCanvasElement) { init { jq(canvas).click { val mousePos = mousePos(it) - @shapeLoop for (shape in shapes) { + shapeLoop@ for (shape in shapes) { if (shape is Button && mousePos in shape) { val name = shape.src shape.mouseClick()