FIR checker: resolve property with protected getter and public setter
Assuming Java class `Super` has a protected `getName` method and a public `setName` method. Then, in a subclass of `Super`, FE1.0 allows calls to `setName` via the property syntax if the property is protected and invisible due to dispatch receiver is not `this` or `super`.
This commit is contained in:
committed by
TeamCityServer
parent
f27f91b03a
commit
f35680f0a4
+30
@@ -0,0 +1,30 @@
|
||||
// FILE: j/Super.java
|
||||
package j
|
||||
|
||||
public abstract class Super {
|
||||
protected abstract String getName();
|
||||
public abstract void setName(String s);
|
||||
}
|
||||
|
||||
// FILE: k/test.kt
|
||||
|
||||
package k
|
||||
import j.Super
|
||||
|
||||
abstract class Sub: Super() {
|
||||
fun test(s: Super) {
|
||||
s.<!INVISIBLE_MEMBER!>name<!>
|
||||
s.<!INVISIBLE_MEMBER!>getName<!>()
|
||||
s.name = ""
|
||||
s.name = s.<!INVISIBLE_MEMBER!>name<!>
|
||||
s.setName("")
|
||||
}
|
||||
}
|
||||
|
||||
fun test(s: Super) {
|
||||
s.<!INVISIBLE_MEMBER!>name<!>
|
||||
s.<!INVISIBLE_MEMBER!>getName<!>()
|
||||
s.<!INVISIBLE_MEMBER!>name<!> = ""
|
||||
s.<!INVISIBLE_MEMBER!>name<!> = s.<!INVISIBLE_MEMBER!>name<!>
|
||||
s.setName("")
|
||||
}
|
||||
Reference in New Issue
Block a user