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

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.6, 3.0.0-beta-1
    • Component/s: Compiler
    • Labels:
      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

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: