[FE 1.0] Report INVISIBLE_MEMBER on all qualified expressions including safe call ones

^KT-47621 Fixed
This commit is contained in:
Victor Petukhov
2022-07-07 13:18:01 +02:00
committed by teamcity
parent e63e889a1f
commit fb21937eb1
8 changed files with 98 additions and 2 deletions
@@ -0,0 +1,23 @@
// WITH_STDLIB
// FILE: j/J.java
package j;
public class J {
public int getX() { return 1; }
protected void setX(int value) { throw new RuntimeException(); }
}
// FILE: main.kt
import j.*
class C : J() {
fun foo() {
<!INVISIBLE_SETTER!>J()<!UNNECESSARY_SAFE_CALL!>?.<!>x<!> = 1
}
}
fun box(): String {
C().foo()
return "OK"
}
@@ -0,0 +1,23 @@
// WITH_STDLIB
// FILE: j/J.java
package j;
public class J {
public int getX() { return 1; }
protected void setX(int value) { throw new RuntimeException(); }
}
// FILE: main.kt
import j.*
class C : J() {
fun foo() {
J()<!UNNECESSARY_SAFE_CALL!>?.<!><!INVISIBLE_SETTER!>x<!> = 1
}
}
fun box(): String {
C().foo()
return "OK"
}
@@ -0,0 +1,25 @@
package
public fun box(): kotlin.String
public final class C : j.J {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun getX(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun setX(/*0*/ value: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
package j {
public open class J {
public constructor J()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun getX(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
protected/*protected and package*/ open fun setX(/*0*/ value: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}