[ 
https://issues.apache.org/jira/browse/GROOVY-6278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-6278:
------------------------------
    Description: 
{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.

  was:
{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.


> 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)

Reply via email to