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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.19, 3.0.4, 2.5.12
    • Fix Version/s: 4.0.0-alpha-1, 3.0.5
    • Component/s: None
    • Labels:

      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

              • Assignee:
                paulk Paul King
                Reporter:
                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