Add recovery for properties without name
If property name is parsed on the next line and declaration is invalid (no receiver/type/initializer), treat that name as it does not belong to property #KT-12987 In Progress
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
fun foo() {
|
||||
val
|
||||
println("abc")
|
||||
|
||||
val
|
||||
lambdaCall {
|
||||
|
||||
}
|
||||
|
||||
val
|
||||
if (1 == 1) {
|
||||
|
||||
}
|
||||
|
||||
val
|
||||
(1 + 2)
|
||||
|
||||
// `propertyNameOnTheNextLine` parsed as simple name expression
|
||||
val
|
||||
propertyNameOnTheNextLine
|
||||
|
||||
val
|
||||
// comment
|
||||
propertyNameOnTheNextLine
|
||||
|
||||
val /* comment */
|
||||
propertyNameOnTheNextLine
|
||||
|
||||
// Correct properties
|
||||
val
|
||||
property1 = 1
|
||||
|
||||
val
|
||||
propertyWithBy by lazy { 1 }
|
||||
|
||||
val
|
||||
propertyWithType: Int
|
||||
|
||||
val
|
||||
(a, b) = 1
|
||||
}
|
||||
Reference in New Issue
Block a user