[FIR] Implement INVISIBLE_SETTER

This commit is contained in:
Ivan Kochurkin
2021-07-27 22:40:00 +03:00
committed by teamcityserver
parent ca4410aa53
commit b3d7ed569d
39 changed files with 288 additions and 180 deletions
@@ -13,6 +13,6 @@ class B {
class C: A() {
init {
B.foo() // Error: receiver is not suitable
B.<!INVISIBLE_REFERENCE!>foo<!>() // Error: receiver is not suitable
}
}
@@ -21,9 +21,8 @@ class B : A() {
b.foo
b.bar = b.bar + ""
a.foo
// TODO: should be INVISIBLE_SETTER
a.bar = a.bar + ""
a.<!INVISIBLE_REFERENCE!>foo<!>
<!INVISIBLE_SETTER!>a.bar<!> = a.bar + ""
if (a is B) {
a.foo
@@ -32,14 +31,13 @@ class B : A() {
if (d.x is B) {
d.x.abc // Ok
d.x.foo
// TODO: should be INVISIBLE_SETTER
d.x.bar = d.x.bar + ""
d.x.<!INVISIBLE_REFERENCE!>foo<!>
<!INVISIBLE_SETTER!>d.x.bar<!> = d.x.bar + ""
}
}
}
fun baz(a: A) {
a.<!INVISIBLE_REFERENCE!>foo<!>
a.bar = a.bar + ""
<!INVISIBLE_SETTER!>a.bar<!> = a.bar + ""
}
@@ -22,7 +22,6 @@ class B : A() {
b.bar = b.bar + ""
a.<!INVISIBLE_MEMBER!>foo<!>
// TODO: should be INVISIBLE_SETTER
a.<!INVISIBLE_SETTER!>bar<!> = a.bar + ""
if (a is B) {
@@ -33,7 +32,6 @@ class B : A() {
if (d.x is B) {
d.x.abc // Ok
d.x.<!INVISIBLE_MEMBER!>foo<!>
// TODO: should be INVISIBLE_SETTER
d.x.<!INVISIBLE_SETTER!>bar<!> = d.x.bar + ""
}
}
@@ -11,7 +11,7 @@ class Data(var x: A)
class B : A() {
fun baz(a: A, b: B, d: Data) {
a.foo { }
a.<!INVISIBLE_REFERENCE!>foo<!> { }
b.foo { }
@@ -20,7 +20,7 @@ class B : A() {
}
if (d.x is B) {
d.x.foo {}
d.x.<!INVISIBLE_REFERENCE!>foo<!> {}
}
}
}
@@ -11,8 +11,8 @@ fun BaseOuter.foo(): String = ""
class Derived : BaseOuter() {
fun test(foo: Foo) {
if (foo.base is Derived) {
foo.base.foo() checkType { <!INAPPLICABLE_CANDIDATE!>_<!><String>() } // Resolved to extension
foo.base.bar()
foo.base.foo() checkType { _<String>() } // Resolved to extension
foo.base.<!INVISIBLE_REFERENCE!>bar<!>()
}
}
}
@@ -11,11 +11,11 @@ class Derived : Base() {
override fun bar() { }
protected fun baz(x: Base) {
x.foo()
x.bar()
x.<!INVISIBLE_REFERENCE!>foo<!>()
x.<!INVISIBLE_REFERENCE!>bar<!>()
x.x = x.x + 1
x.y = x.y + 1
x.<!INVISIBLE_REFERENCE!>x<!> = x.<!INVISIBLE_REFERENCE!>x<!> + 1
<!INVISIBLE_SETTER!>x.y<!> = x.y + 1
if (x is Derived) {
x.foo()