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:
Vendored
+29
@@ -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 + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user