[FIR, LT] Report syntax error by traversing LT after parsing
#KT-57756 Fixed
This commit is contained in:
committed by
Space Team
parent
b07e4f26ef
commit
3c66ae0f8b
@@ -4,7 +4,7 @@ fun foo(@<!UNRESOLVED_REFERENCE!>varargs<!> f : Int) {}
|
||||
var bar : Int = 1
|
||||
set(@<!UNRESOLVED_REFERENCE!>varargs<!> v) {}
|
||||
|
||||
val x : (Int) -> Int = <!INITIALIZER_TYPE_MISMATCH{LT}!>{@<!UNRESOLVED_REFERENCE!>varargs<!> x <!SYNTAX!>: Int -> x<!>}<!>
|
||||
val x : (Int) -> Int = {@<!UNRESOLVED_REFERENCE!>varargs<!> x <!SYNTAX!>: Int -> x<!>}
|
||||
|
||||
class Hello(@<!UNRESOLVED_REFERENCE!>varargs<!> args: Any) {
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ fun foo(@test f : Int) {}
|
||||
var bar : Int = 1
|
||||
set(@test v) {}
|
||||
|
||||
val x : (Int) -> Int = <!INITIALIZER_TYPE_MISMATCH{LT}!>{@test x <!SYNTAX!>: Int -> x<!>}<!> // todo fix parser annotation on lambda parameter
|
||||
val x : (Int) -> Int = {@test x <!SYNTAX!>: Int -> x<!>} // todo fix parser annotation on lambda parameter
|
||||
|
||||
class Hello(@test args: Any) {
|
||||
}
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// COMPARE_WITH_LIGHT_TREE
|
||||
package h
|
||||
|
||||
class Square() {
|
||||
var size : Double =
|
||||
<!UNRESOLVED_REFERENCE!>set<!>(<!UNRESOLVED_REFERENCE!>value<!>) {
|
||||
//in LT this LAMBDA_EXPRESSION get parsed lazyly, but doesn't got anywhere in FIR tree (as property doesn't have place for it)
|
||||
<!SYNTAX{PSI}!>$area<!> <!SYNTAX{PSI}!>= size * size<!>
|
||||
}
|
||||
|
||||
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>var area : Double<!>
|
||||
private set
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val s = Square()
|
||||
|
||||
s.size = 2.0
|
||||
}
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
// COMPARE_WITH_LIGHT_TREE
|
||||
package h
|
||||
|
||||
class Square() {
|
||||
var size : Double =
|
||||
<!UNRESOLVED_REFERENCE!>set<!>(<!UNRESOLVED_REFERENCE!>value<!>) {
|
||||
//in LT this LAMBDA_EXPRESSION get parsed lazyly, but doesn't got anywhere in FIR tree (as property doesn't have place for it)
|
||||
<!SYNTAX!>$area<!> <!SYNTAX!>= size * size<!>
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ fun sum(a : IntArray) : Int {
|
||||
<!UNRESOLVED_REFERENCE!>res<!> = 0
|
||||
for (e in a)
|
||||
<!UNRESOLVED_REFERENCE!>res<!> +=<!SYNTAX!><!>
|
||||
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY{LT}!>}<!>
|
||||
}
|
||||
fun main() {
|
||||
test(0)
|
||||
test(1, 1)
|
||||
|
||||
@@ -25,5 +25,5 @@ val z = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>z<!>
|
||||
fun block(f : () -> Unit) = f()
|
||||
|
||||
fun bar3() = block{ <!UNRESOLVED_REFERENCE!>foo3<!>() // <-- missing closing curly bracket
|
||||
fun foo3() = block{ <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar3()<!> }<!SYNTAX{PSI}!><!>
|
||||
fun foo3() = block{ <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar3()<!> }<!SYNTAX!><!>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user