[
https://issues.apache.org/jira/browse/GROOVY-6278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15411231#comment-15411231
]
Paul King commented on GROOVY-6278:
-----------------------------------
For completeness, a method example (not just a field) highlighting the bug:
{code}
class Foo { private y(){} }
class Bar extends Foo{}
@groovy.transform.TypeChecked
def baz() { new Bar().y() }
baz()
{code}
> private super class members are not ignored
> -------------------------------------------
>
> Key: GROOVY-6278
> URL: https://issues.apache.org/jira/browse/GROOVY-6278
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation, Static Type Checker
> Affects Versions: 2.3.0
> Reporter: Jochen Theodorou
>
> {code:Java}
> class Foo { private x=2 }
> class Bar extends Foo{}
> @groovy.transform.CompileStatic
> def foo() {
> return new Bar().x
> }
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)