groovy
  1. groovy
  2. GROOVY-4683 static import collection task
  3. GROOVY-4287

CLONE - import of static nested classes in external groovy files is broken

    Details

    • Type: Sub-task Sub-task
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.7.3
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None
    • Number of attachments :
      0

      Description

      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:

      Test.groovy
      import static Outer.*
      // import static Outer.Inner // also fails
      // import Outer.Inner        // also fails
      
      assert Inner.class.name != null
      
      Outer.groovy
      class Outer {
          static class Inner {}
      }
      

      Output:

      Caught: groovy.lang.MissingPropertyException: No such property: Inner for class: Test
              at Test.run(Test.groovy:4)
      

      Error message is slightly different for non-static import:

      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
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul King
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: