Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4683 static import collection task
  3. GROOVY-5852

Static import on demand resolves capitalised reference

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.5.6, 3.0.0-beta-1
    • Compiler
    • None

    Description

      get a class

      class Constants {
        static final pi = 3.14  //final property with implicit getter
      }
      

      and another one

      import static Constants.*
      
      println Pi  // first reference
      println Constants.Pi //second reference
      

      IMHO both references to pi should throw a MissingPropertyException as they have capitalised first letter. Or both of them should not. Now first reference works while the second ref does not.

      BTW if we provide explicit 'public' modifier to pi, both references fail.

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              mxm-groovy Maxim Medvedev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: