Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7812

Static inner classes cannot be accessed from other files when running by 'groovy' command

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.6
    • Fix Version/s: 2.5.6, 3.0.0-beta-1
    • Component/s: Compiler
    • Labels:
      None

      Description

      Create the following files

      Outer.groovy
      class Outer {
        static class Inner {
        }
      }
      
      Main.groovy
      println new Outer()
      println new Outer.Inner()
      

      and run 'groovy Main.groovy'. It'll fail with the following message:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      /home/.../Main.groovy: 2: unable to resolve class Outer.Inner
      @ line 2, column 9.
      println new Outer.Inner()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                daniel_sun Daniel Sun
                Reporter:
                chashnikov Nikolay Chashnikov
              • Votes:
                3 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m