Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.0
-
None
-
None
Description
class Foo { private x=2 } class Bar extends Foo{} @groovy.transform.CompileStatic def foo() { return new Bar().x }
the logic in existsProperty finds Foo#x, even though it is private. Groovy does not allow access to super class private members. Compilation should fail here in static compilation mode as well as with the type checker.
Attachments
Issue Links
- relates to
-
GROOVY-9850 STC: add error for write of private or package-private field of super class
- Resolved
-
GROOVY-9093 SC: subclass access to package-private or private field is not indicated as an error
- Closed