You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2021/03/19 19:37:36 UTC

[groovy] branch GROOVY_3_0_X updated: GROOVY-7024: add test case

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
     new 351240e  GROOVY-7024: add test case
351240e is described below

commit 351240ee4ff328a0fc64cec7e23f24773236aca2
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Fri Mar 19 14:30:26 2021 -0500

    GROOVY-7024: add test case
---
 .../transform/stc/FieldsAndPropertiesSTCTest.groovy     | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/test/groovy/transform/stc/FieldsAndPropertiesSTCTest.groovy b/src/test/groovy/transform/stc/FieldsAndPropertiesSTCTest.groovy
index 75a6cea..42dc99c 100644
--- a/src/test/groovy/transform/stc/FieldsAndPropertiesSTCTest.groovy
+++ b/src/test/groovy/transform/stc/FieldsAndPropertiesSTCTest.groovy
@@ -562,6 +562,23 @@ class FieldsAndPropertiesSTCTest extends StaticTypeCheckingTestCase {
         ''', 'No such property: p for class: Outer$Inner'
     }
 
+    // GROOVY-7024
+    void testOuterPropertyAccess4() {
+        assertScript '''
+            class Outer {
+                static Map props = [bar: 10, baz: 20]
+                enum Inner {
+                    FOO('foo'),
+                    Inner(String name) {
+                        props[name] = 30
+                    }
+                }
+            }
+            Outer.Inner.FOO
+            assert Outer.props == [bar: 10, baz: 20, foo: 30]
+        '''
+    }
+
     void testPrivateFieldAccessInAIC() {
         assertScript '''
             class A {