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

Property reference resolves to field, not getter when property name is single upper-case letter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.19, 3.0.4, 2.5.12
    • 4.0.0-alpha-1, 3.0.5
    • None

    Description

      Consider the following:

      class A {
        private static X = 1
        static getX() { 2 }
        static class B {
        }
      }
      class C extends A.B {
        void test() {
          print X
        }
      }
      new C().test()
      

      Execution of this script prints "1" when "2" is expected. If static property name is changed to "XY" or "x" the resolution works as expected.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 2.5h
                  2.5h