Files
kotlin-fork/idea/testData/checker/BreakContinue.fir.kt
T
Tianyu Geng f38c0cf348 FIR IDE: run FIR highlighting test on all test data
Similarly to FIR diagnostic tests. This commit enable all available test
data and check the reported error messages by FIR. This helps identify
some issues in formatting of FIR diagnostics.

The changes on the test file are mechanically generated. Failed tests
are disabled with `// IGNORE_FIR` and are re-enabled in the second
commit.
2021-03-29 12:45:27 +03:00

29 lines
1.1 KiB
Kotlin
Vendored

class C {
fun f (a : Boolean, b : Boolean) {
b@ (while (true)
a@ {
<error descr="[NOT_A_LOOP_LABEL] The label does not denote a loop">break@f</error>
break
break@b
<error descr="[NOT_A_LOOP_LABEL] The label does not denote a loop">break@a</error>
})
<error descr="[BREAK_OR_CONTINUE_OUTSIDE_A_LOOP] 'break' and 'continue' are only allowed inside a loop">continue</error>
b@ (while (true)
a@ {
<error descr="[NOT_A_LOOP_LABEL] The label does not denote a loop">continue@f</error>
continue
continue@b
<error descr="[NOT_A_LOOP_LABEL] The label does not denote a loop">continue@a</error>
})
<error descr="[BREAK_OR_CONTINUE_OUTSIDE_A_LOOP] 'break' and 'continue' are only allowed inside a loop">break</error>
<error descr="[BREAK_OR_CONTINUE_OUTSIDE_A_LOOP] 'break' and 'continue' are only allowed inside a loop">continue@f</error>
<error descr="[BREAK_OR_CONTINUE_OUTSIDE_A_LOOP] 'break' and 'continue' are only allowed inside a loop">break@f</error>
}
}