Replace some FIR syntax errors with more proper diagnostics
This commit is contained in:
+11
-11
@@ -3,26 +3,26 @@ class C {
|
||||
fun f (a : Boolean, b : Boolean) {
|
||||
b@ while (true)
|
||||
a@ {
|
||||
break@f
|
||||
<!NOT_A_LOOP_LABEL!>break@f<!>
|
||||
break
|
||||
break@b
|
||||
break@a
|
||||
<!NOT_A_LOOP_LABEL!>break@a<!>
|
||||
}
|
||||
|
||||
continue
|
||||
<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue<!>
|
||||
|
||||
b@ while (true)
|
||||
a@ {
|
||||
continue@f
|
||||
<!NOT_A_LOOP_LABEL!>continue@f<!>
|
||||
continue
|
||||
continue@b
|
||||
continue@a
|
||||
<!NOT_A_LOOP_LABEL!>continue@a<!>
|
||||
}
|
||||
|
||||
break
|
||||
<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>break<!>
|
||||
|
||||
continue@f
|
||||
break@f
|
||||
<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>continue@f<!>
|
||||
<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>break@f<!>
|
||||
}
|
||||
|
||||
fun containsBreak(a: String?, b: String?) {
|
||||
@@ -50,7 +50,7 @@ class C {
|
||||
|
||||
fun containsIllegalBreak(a: String?) {
|
||||
loop@ while(a == null) {
|
||||
break@label
|
||||
<!NOT_A_LOOP_LABEL!>break@label<!>
|
||||
}
|
||||
a.compareTo("2")
|
||||
}
|
||||
@@ -78,7 +78,7 @@ class C {
|
||||
l@ for (el in array) {
|
||||
break
|
||||
}
|
||||
if (true) break else break@l
|
||||
if (true) break else <!NOT_A_LOOP_LABEL!>break@l<!>
|
||||
}
|
||||
a.<!INAPPLICABLE_CANDIDATE!>compareTo<!>("2")
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class C {
|
||||
fun twoLabelsOnLoop() {
|
||||
label1@ label2@ for (i in 1..100) {
|
||||
if (i > 0) {
|
||||
break@label1
|
||||
<!NOT_A_LOOP_LABEL!>break@label1<!>
|
||||
}
|
||||
else {
|
||||
break@label2
|
||||
|
||||
Reference in New Issue
Block a user