[ 
https://issues.apache.org/jira/browse/GROOVY-7762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15170344#comment-15170344
 ] 

Paul King commented on GROOVY-7762:
-----------------------------------

This is actually a naming limitation. There is probably an existing related bug 
somewhere mentioning inherited static members but probably not with inner 
classes but some other kind of member.

The current workaround is to use the fully referenced name from the parent 
class:
{code}
class Z extends X {
    Z() {
        X$Y y = new X$Y() // or X.Y y = new X.Y()
    }
}
{code}

> Static inner classes not visible to child classes
> -------------------------------------------------
>
>                 Key: GROOVY-7762
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7762
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: class generator
>    Affects Versions: 2.1.6, 2.2.0-beta-1, 2.1.7, 2.2.0, 2.4.0-beta-3
>            Reporter: Kenneth Gendron
>
> If both the parent class and the child are in the same file or project (i.e. 
> they are being compiled together), this works; however, if the parent is 
> compiled into a separate JAR, the child class is unable to see the parents 
> inner classes.
> Example:
> {code}class X {
>     static class Y {}
> }{code}
> Compile X into a separate JAR.
> {code}class Z extends X {
>     Z() {
>         Y y = new Y();
>     }
> }{code}
> Compiling Z will cause an error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to