[FIR] Report VAL_REASSIGNMENT on assign to non-local vals
In this commit reporting on member properties in init section of class is not supported (see KT-55528) ^KT-55493 Fixed
This commit is contained in:
committed by
Space Team
parent
e87a064cdd
commit
02e327277e
Vendored
+15
-15
@@ -116,8 +116,8 @@ class AnonymousInitializers(var a: String, val b: String) {
|
||||
a = "30"
|
||||
a = "s"
|
||||
|
||||
b = "3"
|
||||
b = "tt" //repeat for b
|
||||
<!VAL_REASSIGNMENT!>b<!> = "3"
|
||||
<!VAL_REASSIGNMENT!>b<!> = "tt" //repeat for b
|
||||
}
|
||||
|
||||
val i: Int
|
||||
@@ -127,7 +127,7 @@ class AnonymousInitializers(var a: String, val b: String) {
|
||||
|
||||
init {
|
||||
x = 11
|
||||
z = 10
|
||||
<!VAL_REASSIGNMENT!>z<!> = 10
|
||||
}
|
||||
|
||||
val j: Int
|
||||
@@ -135,7 +135,7 @@ class AnonymousInitializers(var a: String, val b: String) {
|
||||
|
||||
init {
|
||||
i = 13
|
||||
j = 34
|
||||
<!VAL_REASSIGNMENT!>j<!> = 34
|
||||
}
|
||||
|
||||
val k: String
|
||||
@@ -228,13 +228,13 @@ class Outer() {
|
||||
|
||||
inner class Inner() {
|
||||
init {
|
||||
a++
|
||||
<!VAL_REASSIGNMENT!>a<!>++
|
||||
b++
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
a++
|
||||
<!VAL_REASSIGNMENT!>a<!>++
|
||||
b++
|
||||
}
|
||||
}
|
||||
@@ -271,8 +271,8 @@ fun foo() {
|
||||
z = 3
|
||||
}
|
||||
fun foo() {
|
||||
y = 10
|
||||
z = 13
|
||||
<!VAL_REASSIGNMENT!>y<!> = 10
|
||||
<!VAL_REASSIGNMENT!>z<!> = 13
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -290,12 +290,12 @@ class TestObjectExpression() {
|
||||
x = 1
|
||||
}
|
||||
fun inner1() {
|
||||
y = 101
|
||||
a = 231
|
||||
<!VAL_REASSIGNMENT!>y<!> = 101
|
||||
<!VAL_REASSIGNMENT!>a<!> = 231
|
||||
}
|
||||
fun inner2() {
|
||||
y = 101
|
||||
a = 231
|
||||
<!VAL_REASSIGNMENT!>y<!> = 101
|
||||
<!VAL_REASSIGNMENT!>a<!> = 231
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,7 +311,7 @@ object TestObjectDeclaration {
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
y = 10
|
||||
<!VAL_REASSIGNMENT!>y<!> = 10
|
||||
val i: Int
|
||||
if (1 < 3) {
|
||||
i = 10
|
||||
@@ -338,11 +338,11 @@ class M() {
|
||||
}
|
||||
|
||||
fun test(m : M) {
|
||||
m.x = 23
|
||||
m.<!VAL_REASSIGNMENT!>x<!> = 23
|
||||
m.y = 23
|
||||
}
|
||||
|
||||
fun test1(m : M) {
|
||||
m.x++
|
||||
m.<!VAL_REASSIGNMENT!>x<!>++
|
||||
m.y--
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user