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:
+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 + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.<!INVISIBLE_SETTER!>bar<!> = t.bar
|
||||
<!VAL_REASSIGNMENT!>a.foo<!> = t.foo
|
||||
|
||||
if (d.x is B) {
|
||||
d.x.<!INVISIBLE_SETTER!>bar<!> = d.x.bar + ""
|
||||
d.x.foo = d.x.foo + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package
|
||||
|
||||
public final class B : abc.Foo {
|
||||
public constructor B()
|
||||
public final fun baz(/*0*/ a: abc.Foo, /*1*/ t: abc.Foo, /*2*/ d: Data): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun getBar(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun getFoo(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun setBar(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun setFoo(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Data {
|
||||
public constructor Data(/*0*/ x: abc.Foo)
|
||||
public final var x: abc.Foo
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
package abc {
|
||||
|
||||
public open class Foo {
|
||||
public constructor Foo()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getBar(): kotlin.String!
|
||||
public open fun getFoo(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
protected/*protected and package*/ open fun setBar(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
private open fun setFoo(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
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 + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
<!VAL_REASSIGNMENT!>a.foo<!> = t.foo
|
||||
|
||||
if (d.x is B) {
|
||||
d.x.bar = d.x.bar + ""
|
||||
d.x.foo = d.x.foo + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
package
|
||||
|
||||
public final class B : abc.Foo {
|
||||
public constructor B()
|
||||
public final fun baz(/*0*/ a: abc.Foo, /*1*/ t: abc.Foo, /*2*/ d: Data): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun getBar(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun getFoo(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun setBar(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun setFoo(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Data {
|
||||
public constructor Data(/*0*/ x: abc.Foo)
|
||||
public final var x: abc.Foo
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
package abc {
|
||||
|
||||
public open class Foo {
|
||||
public constructor Foo()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getBar(): kotlin.String!
|
||||
public open fun getFoo(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
protected/*protected and package*/ open fun setBar(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
private open fun setFoo(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// FILE: Foo.java
|
||||
public class Foo {
|
||||
public String getBar() { return ""; }
|
||||
protected void setBar(String x) { }
|
||||
public String getFoo() { return ""; }
|
||||
private void setFoo(String x) { }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
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 + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// FILE: Foo.java
|
||||
public class Foo {
|
||||
public String getBar() { return ""; }
|
||||
protected void setBar(String x) { }
|
||||
public String getFoo() { return ""; }
|
||||
private void setFoo(String x) { }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
class Data(var x: Foo)
|
||||
|
||||
class B : Foo() {
|
||||
fun baz(a: Foo, t: Foo, d: Data) {
|
||||
a.bar = t.bar
|
||||
<!VAL_REASSIGNMENT!>a.foo<!> = t.foo
|
||||
|
||||
if (d.x is B) {
|
||||
d.x.bar = d.x.bar + ""
|
||||
d.x.foo = d.x.foo + ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
public final class B : Foo {
|
||||
public constructor B()
|
||||
public final fun baz(/*0*/ a: Foo, /*1*/ t: Foo, /*2*/ d: Data): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun getBar(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun getFoo(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun setBar(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun setFoo(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Data {
|
||||
public constructor Data(/*0*/ x: Foo)
|
||||
public final var x: Foo
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class Foo {
|
||||
public constructor Foo()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun getBar(): kotlin.String!
|
||||
public open fun getFoo(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
protected/*protected and package*/ open fun setBar(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
private open fun setFoo(/*0*/ x: kotlin.String!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user