[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
@@ -32,5 +32,5 @@ fun `should not report an error for assign return type for unannotated class`()
|
||||
data class IntTask(val input: IntProperty)
|
||||
|
||||
val task = IntTask(IntProperty(42))
|
||||
task.input = <!ASSIGNMENT_TYPE_MISMATCH!>42<!>
|
||||
task.<!VAL_REASSIGNMENT!>input<!> = <!ASSIGNMENT_TYPE_MISMATCH!>42<!>
|
||||
}
|
||||
|
||||
@@ -14,16 +14,16 @@ data class Task(val input: StringProperty)
|
||||
|
||||
fun `should not work with assignment when there is no annotation on a type`() {
|
||||
val task = Task(StringProperty("Fail"))
|
||||
task.input = <!ASSIGNMENT_TYPE_MISMATCH!>"OK"<!>
|
||||
task.input = StringProperty("OK")
|
||||
task.<!VAL_REASSIGNMENT!>input<!> = <!ASSIGNMENT_TYPE_MISMATCH!>"OK"<!>
|
||||
task.<!VAL_REASSIGNMENT!>input<!> = StringProperty("OK")
|
||||
task.apply {
|
||||
input = <!ASSIGNMENT_TYPE_MISMATCH!>"OK"<!>
|
||||
<!VAL_REASSIGNMENT!>input<!> = <!ASSIGNMENT_TYPE_MISMATCH!>"OK"<!>
|
||||
}
|
||||
task.apply {
|
||||
input = StringProperty("OK")
|
||||
<!VAL_REASSIGNMENT!>input<!> = StringProperty("OK")
|
||||
}
|
||||
task.input = <!ASSIGNMENT_TYPE_MISMATCH!>42<!>
|
||||
task.<!VAL_REASSIGNMENT!>input<!> = <!ASSIGNMENT_TYPE_MISMATCH!>42<!>
|
||||
task.apply {
|
||||
input = <!ASSIGNMENT_TYPE_MISMATCH!>42<!>
|
||||
<!VAL_REASSIGNMENT!>input<!> = <!ASSIGNMENT_TYPE_MISMATCH!>42<!>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user