[FIR] Report VARIABLE_EXPECTED on assign to this

This commit is contained in:
Dmitriy Novozhilov
2022-12-15 15:06:44 +02:00
committed by Space Team
parent 9ccbf8639d
commit e87a064cdd
2 changed files with 15 additions and 3 deletions
@@ -22,7 +22,7 @@ class C() : B() {
}
fun bar(c: C) {
this = c //should be an error
<!VARIABLE_EXPECTED!>this<!> = c //should be an error
}
}
@@ -31,7 +31,7 @@ fun getInt() = 0
class D() {
inner class B() {
fun foo() {
this@D = D()
<!VARIABLE_EXPECTED!>this@D<!> = D()
}
}
}
@@ -93,7 +93,7 @@ class Test() {
++<!VARIABLE_EXPECTED!>2<!>
--(r@ <!VARIABLE_EXPECTED!>2<!>)
this<!UNRESOLVED_REFERENCE!>++<!>
<!VARIABLE_EXPECTED!>this<!><!UNRESOLVED_REFERENCE!>++<!>
var s : String = "r"
s += "ss"