Replace some FIR syntax errors with more proper diagnostics
This commit is contained in:
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
|
||||
fun foo1() = while (b()) {}
|
||||
fun foo1() = <!EXPRESSION_REQUIRED!>while (b()) {}<!>
|
||||
|
||||
fun foo2() = <!UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for (i in 10) {}<!>
|
||||
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ class Test3 {
|
||||
}
|
||||
|
||||
fun test4() {
|
||||
break@test4
|
||||
<!BREAK_OR_CONTINUE_OUTSIDE_A_LOOP!>break@test4<!>
|
||||
}
|
||||
|
||||
class Test5 {
|
||||
@@ -43,11 +43,11 @@ class Test6 {
|
||||
class Test7 {
|
||||
fun Test7() {
|
||||
Test8@ while (true) {
|
||||
break@Test7
|
||||
<!NOT_A_LOOP_LABEL!>break@Test7<!>
|
||||
}
|
||||
|
||||
Test7@ while (true) {
|
||||
break@Test8
|
||||
<!NOT_A_LOOP_LABEL!>break@Test8<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
compiler/testData/diagnostics/tests/controlStructures/kt770.fir.kt351.fir.kt735_StatementType.fir.kt
Vendored
+5
-5
@@ -15,7 +15,7 @@ fun main() {
|
||||
}
|
||||
|
||||
//KT-351 Distinguish statement and expression positions
|
||||
val w = while (true) {}
|
||||
val w = <!EXPRESSION_REQUIRED!>while (true) {}<!>
|
||||
|
||||
fun foo() {
|
||||
var z = 2
|
||||
@@ -152,12 +152,12 @@ fun bar(a: Unit) {}
|
||||
|
||||
fun testStatementInExpressionContext() {
|
||||
var z = 34
|
||||
val a1: Unit = z = 334
|
||||
val a1: Unit = <!EXPRESSION_REQUIRED!>z = 334<!>
|
||||
val f = for (i in 1..10) {}
|
||||
if (true) return z = 34
|
||||
return while (true) {}
|
||||
if (true) return <!EXPRESSION_REQUIRED!>z = 34<!>
|
||||
return <!EXPRESSION_REQUIRED!>while (true) {}<!>
|
||||
}
|
||||
|
||||
fun testStatementInExpressionContext2() {
|
||||
val a2: Unit = while(true) {}
|
||||
val a2: Unit = <!EXPRESSION_REQUIRED!>while(true) {}<!>
|
||||
}
|
||||
Reference in New Issue
Block a user