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/01/13 11:51:00 UTC

[jira] [Updated] (GROOVY-4287) CLONE - import of static nested classes in external groovy files is broken

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

Daniel Sun updated GROOVY-4287:
-------------------------------
    Fix Version/s: 3.0.0-alpha-5
                   2.5.6

> CLONE - import of static nested classes in external groovy files is broken
> --------------------------------------------------------------------------
>
>                 Key: GROOVY-4287
>                 URL: https://issues.apache.org/jira/browse/GROOVY-4287
>             Project: Groovy
>          Issue Type: Sub-task
>          Components: Compiler
>    Affects Versions: 1.7.3
>            Reporter: Paul King
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.5.6, 3.0.0-alpha-5
>
>
> Splitting off problematic but critical case of resolving static nested and inner classes in external groovy files from GROOVY-4267. Copying Roshan's example from that issue:
> {code:title=Test.groovy}
> import static Outer.*
> // import static Outer.Inner // also fails
> // import Outer.Inner        // also fails
> assert Inner.class.name != null
> {code}
> {code:title=Outer.groovy}
> class Outer {
>     static class Inner {}
> }
> {code}
> Output:
> {noformat}
> Caught: groovy.lang.MissingPropertyException: No such property: Inner for class: Test
>         at Test.run(Test.groovy:4)
> {noformat}
> Error message is slightly different for non-static import:
> {noformat}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> Test.groovy: 2: unable to resolve class Outer.Inner
>  @ line 2, column 1.
>    import Outer.Inner
>    ^
> 1 error
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)