GROOVY-9618: Property reference resolves to field, not getter when property name is single upper-case letter (additional test - closes #1316)
diff --git a/src/test/groovy/PropertyTest.groovy b/src/test/groovy/PropertyTest.groovy
index 4f49395..a9f55f7 100644
--- a/src/test/groovy/PropertyTest.groovy
+++ b/src/test/groovy/PropertyTest.groovy
@@ -557,6 +557,22 @@
assert Pi.toString().startsWith('3')
'''
}
+
+ void testPropertyAndStaticUppercaseFieldPriority() { // GROOVY-9618
+ assertScript '''
+ class A {
+ public static X = 1
+ static getX() { 2 }
+ static class B { }
+ }
+ class C extends A.B {
+ def test() {
+ X
+ }
+ }
+ assert new C().test() == 2
+ '''
+ }
}
class Base {