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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.6
    • 2.5.6, 3.0.0-beta-1
    • Compiler
    • 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

              daniel_sun Daniel Sun
              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