Report invisible setter error if it's resolved to synthetic property of base class with public getter and protected setter

^KT-11713 Fixed
This commit is contained in:
Victor Petukhov
2020-09-21 23:53:13 +03:00
parent fdd71c0bce
commit fcfabb70d5
21 changed files with 372 additions and 36 deletions
@@ -0,0 +1,29 @@
// !LANGUAGE: -ImproveReportingDiagnosticsOnProtectedMembersOfBaseClass
// FILE: abc/Foo.java
package abc;
public class Foo {
public String getBar() { return ""; }
protected void setBar(String x) { }
public String getFoo() { return ""; }
private void setFoo(String x) { }
}
// FILE: main.kt
import abc.Foo
class Data(var x: Foo)
class B : Foo() {
fun baz(a: Foo, t: Foo, d: Data) {
a.bar = t.bar
a.foo = t.foo
if (d.x is B) {
d.x.bar = d.x.bar + ""
d.x.foo = d.x.foo + ""
}
}
}