You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2019/09/02 15:23:00 UTC

[jira] [Updated] (GROOVY-9243) Fail to resolve nested type defined in base type written in Groovy

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

Daniel Sun updated GROOVY-9243:
-------------------------------
    External issue URL: https://github.com/apache/groovy/pull/1002

> Fail to resolve nested type defined in base type written in Groovy
> ------------------------------------------------------------------
>
>                 Key: GROOVY-9243
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9243
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Daniel Sun
>            Priority: Minor
>
> *file Base.groovy:*
> {code:java}
> package groovy.bugs.groovy9243
> class Base {
>     static class X {}
> }
> {code}
> *file Main.groovy:*
> {code:java}
> package groovy.bugs.groovy9243
> class Groovy9243 extends Base {
>     def accessX() {
>         assert new X()
>     }
> }
> new Groovy9243().accessX()
> {code}
> compile Main.groovy with groovyc: {{unable to resolve class X}}
> Here is a workaround:
> *file Main.groovy:*
> {code:java}
> package groovy.bugs.groovy9243
> class Groovy9243 extends Base {
>     def accessX() {
>         assert new Base.X()  // qualify the type name
>     }
> }
> new Groovy9243().accessX()
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)