[FIR] Check for setter visibility in resolution stage

This is required for the following commit where candidates from the
original scope in presence of smart cast will not be ignored if they're
the same symbol.
This commit is contained in:
Kirill Rakhman
2023-12-18 11:42:29 +01:00
committed by Space Team
parent 737b286d5c
commit 5186ba80e2
15 changed files with 44 additions and 76 deletions
@@ -35,7 +35,7 @@ fun test() {
val u : <!INVISIBLE_REFERENCE!>A<!> = <!INVISIBLE_REFERENCE!>A<!>()
val z = <!INVISIBLE_REFERENCE!>x<!>
<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>x<!> = 30
<!INVISIBLE_REFERENCE!>x<!> = 30
val po = <!INVISIBLE_REFERENCE!>PO<!>
@@ -26,7 +26,7 @@ package foo
fun test(s: bar.Sub<String>) {
s.<!INVISIBLE_REFERENCE!>name<!>
s.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>name<!> = ""
s.<!INVISIBLE_REFERENCE!>name<!> = ""
s.name2
s.name2 = ""
s.<!INVISIBLE_REFERENCE!>doSomething<!>()
+1 -1
View File
@@ -8,6 +8,6 @@ class A {
class B() {
init {
A().<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>a<!> = "Hello"
A().<!INVISIBLE_REFERENCE!>a<!> = "Hello"
}
}
+1 -1
View File
@@ -6,6 +6,6 @@ class A(private var i: Int, var j: Int) {
}
fun test(a: A) {
a.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>i<!>++
a.<!INVISIBLE_REFERENCE!>i<!>++
a.j++
}
@@ -14,7 +14,7 @@ class Derived : Base() {
x.<!INVISIBLE_REFERENCE!>foo<!>()
x.<!INVISIBLE_REFERENCE!>bar<!>()
x.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>x<!> = x.<!INVISIBLE_REFERENCE!>x<!> + 1
x.<!INVISIBLE_REFERENCE!>x<!> = x.<!INVISIBLE_REFERENCE!>x<!> + 1
x.<!INVISIBLE_SETTER!>y<!> = x.y + 1
if (x is Derived) {
@@ -54,7 +54,7 @@ open class C : T {
}
fun test4(c: C) {
c.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>i<!>++
c.<!INVISIBLE_REFERENCE!>i<!>++
}
class D : C() {
@@ -31,7 +31,7 @@ fun test() {
val u : <!INVISIBLE_REFERENCE!>A<!> = <!INVISIBLE_REFERENCE!>A<!>()
val z = <!INVISIBLE_REFERENCE!>x<!>
<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>x<!> = 30
<!INVISIBLE_REFERENCE!>x<!> = 30
val po = <!INVISIBLE_REFERENCE!>PO<!>
}
@@ -15,23 +15,23 @@ class Test<in I, out O> {
this.i = getT()
with(Test<I, O>()) {
i = getT() // resolved to this@Test.i
this.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>i<!> = getT()
this@with.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>i<!> = getT()
this.<!INVISIBLE_REFERENCE!>i<!> = getT()
this@with.<!INVISIBLE_REFERENCE!>i<!> = getT()
this@Test.i = getT()
}
}
fun <I, O> test(t: Test<I, O>) {
t.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>i<!> = getT()
t.<!INVISIBLE_REFERENCE!>i<!> = getT()
}
companion object {
fun <I, O> test(t: Test<I, O>) {
t.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>i<!> = getT()
t.<!INVISIBLE_REFERENCE!>i<!> = getT()
}
}
}
fun <I, O> test(t: Test<I, O>) {
t.<!INVISIBLE_REFERENCE, INVISIBLE_SETTER!>i<!> = getT()
t.<!INVISIBLE_REFERENCE!>i<!> = getT()
}