[FIR] Forbid multiple labels per statement
^KT-53629: Fixed
This commit is contained in:
committed by
Space Team
parent
cd5b38b958
commit
d27adf6677
+10
@@ -0,0 +1,10 @@
|
||||
// K2: See KT-65342
|
||||
|
||||
fun test() {
|
||||
<!MULTIPLE_LABELS_ARE_FORBIDDEN!>a@<!> b@ while(true) {
|
||||
val f = {
|
||||
return@a
|
||||
}
|
||||
break@b
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// K2: See KT-65342
|
||||
|
||||
fun test() {
|
||||
a@ b@ while(true) {
|
||||
val f = {
|
||||
|
||||
+3
-3
@@ -30,12 +30,12 @@ fun testAnnotatedLambdaLabel() =
|
||||
}
|
||||
|
||||
fun testLambdaMultipleLabels1() =
|
||||
lambda1@ lambda2@ {
|
||||
<!MULTIPLE_LABELS_ARE_FORBIDDEN!>lambda1@<!> lambda2@ {
|
||||
<!NOT_A_FUNCTION_LABEL!>return@lambda1<!>
|
||||
}
|
||||
|
||||
fun testLambdaMultipleLabels2() =
|
||||
lambda1@ lambda2@ {
|
||||
<!MULTIPLE_LABELS_ARE_FORBIDDEN!>lambda1@<!> lambda2@ {
|
||||
return@lambda2
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ fun testHighOrderFunctionCallLabelInReturn() {
|
||||
}
|
||||
|
||||
fun testMultipleLabelsWithNestedLambda() {
|
||||
l1@ l2@{
|
||||
<!MULTIPLE_LABELS_ARE_FORBIDDEN!>l1@<!> l2@{
|
||||
{
|
||||
<!NOT_A_FUNCTION_LABEL!>return@l1<!>
|
||||
}
|
||||
|
||||
+3
-3
@@ -30,12 +30,12 @@ fun testAnnotatedLambdaLabel() =
|
||||
}
|
||||
|
||||
fun testLambdaMultipleLabels1() =
|
||||
lambda1@ lambda2@ {
|
||||
<!MULTIPLE_LABELS_ARE_FORBIDDEN!>lambda1@<!> lambda2@ {
|
||||
<!NOT_A_FUNCTION_LABEL!>return@lambda1<!>
|
||||
}
|
||||
|
||||
fun testLambdaMultipleLabels2() =
|
||||
lambda1@ lambda2@ {
|
||||
<!MULTIPLE_LABELS_ARE_FORBIDDEN!>lambda1@<!> lambda2@ {
|
||||
return@lambda2
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ fun testHighOrderFunctionCallLabelInReturn() {
|
||||
}
|
||||
|
||||
fun testMultipleLabelsWithNestedLambda() {
|
||||
l1@ l2@{
|
||||
<!MULTIPLE_LABELS_ARE_FORBIDDEN!>l1@<!> l2@{
|
||||
{
|
||||
<!NOT_A_FUNCTION_LABEL!>return@l1<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user