groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [groovy] 03/03: GROOVY-9618: Property reference resolves to field, not getter when property name is single upper-case letter (additional test - closes #1316)
Date Sat, 18 Jul 2020 03:26:38 GMT
This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 0e355167d5a7c861879dd608c9cd25cf9509664e
Author: Paul King <paulk@asert.com.au>
AuthorDate: Sat Jul 18 13:26:16 2020 +1000

    GROOVY-9618: Property reference resolves to field, not getter when property name is single
upper-case letter (additional test - closes #1316)
---
 src/test/groovy/PropertyTest.groovy | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

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 @@ class PropertyTest extends GroovyTestCase {
             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 {


Mime
View raw message