Add additional visibility check for synthetic extensions
Use extension receiver as dispatch one, because it is effectively dispatch (after some desugaring)
This commit is contained in:
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
// FILE: abc/A.java
|
||||
package abc;
|
||||
public class A {
|
||||
public int getAbc() {}
|
||||
protected int getFoo() { return 1; }
|
||||
|
||||
public String getBar() { return ""; }
|
||||
protected void setBar(String x) { }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
import abc.A
|
||||
|
||||
class Data(var x: A)
|
||||
|
||||
class B : A() {
|
||||
fun baz(a: A, b: B, d: Data) {
|
||||
foo
|
||||
bar = bar + ""
|
||||
|
||||
b.foo
|
||||
b.bar = b.bar + ""
|
||||
|
||||
a.<!INVISIBLE_MEMBER!>foo<!>
|
||||
// TODO: should be INVISIBLE_SETTER
|
||||
a.bar = a.bar + ""
|
||||
|
||||
if (a is B) {
|
||||
<!DEBUG_INFO_SMARTCAST!>a<!>.foo
|
||||
<!DEBUG_INFO_SMARTCAST!>a<!>.bar = <!DEBUG_INFO_SMARTCAST!>a<!>.bar + ""
|
||||
}
|
||||
|
||||
if (d.x is B) {
|
||||
d.x.abc // Ok
|
||||
d.x.<!INVISIBLE_MEMBER!>foo<!>
|
||||
// TODO: should be INVISIBLE_SETTER
|
||||
d.x.bar = d.x.bar + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun baz(a: A) {
|
||||
a.<!INVISIBLE_MEMBER!>foo<!>
|
||||
<!INVISIBLE_SETTER!>a.bar<!> = a.bar + ""
|
||||
}
|
||||
Reference in New Issue
Block a user