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

Static property reference from static context in script does not compile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.6, 2.4.0-beta-3
    • 4.0.0-beta-1, 2.5.16, 3.0.10
    • Compiler
    • None

    Description

      The following script:

      static getStaticProperty() {}
      static staticMethod() { staticProperty }
      

      Does not compile and produces the following error:

      You misspelled a classname or statically imported field. Please check the spelling.
      You attempted to use a method 'staticProperty' but left out brackets in a place not allowed by the grammar.
       @ line 4, column 25.
         static staticMethod() { staticProperty }
                                 ^
      
      1 error
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              btiernay Bob Tiernay
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: