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

Statically imported fields & properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 1.7.2, 1.8-beta-1
    • None
    • None

    Description

      Create class Foo

      class Foo {
        static foo=2
        static getFoo(){
          return 3
        } 
      }
      

      and a script

      import static Foo.foo
      
      print foo
      

      This script calls getter getFoo and prints "3".
      But if you delete declaration "static foo=2" from the class the script fails with MissingPropertyException.
      IMHO the script should call getter in both cases.

      Attachments

        Issue Links

          Activity

            People

              roshandawrani Roshan Dawrani
              mxm-groovy Maxim Medvedev
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: