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


The following commit(s) were added to refs/heads/master by this push:
     new 4f69a3c  GROOVY-8073/GROOVY-7687: add test cases for additional cases 
fixed by GROOVY-7996
4f69a3c is described below

commit 4f69a3c3486687def9561dee308635768d1b36ff
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Jan 22 11:56:18 2019 +1000

    GROOVY-8073/GROOVY-7687: add test cases for additional cases fixed by 
GROOVY-7996
---
 src/test/groovy/bugs/Groovy7996Bug.groovy | 39 +++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/src/test/groovy/bugs/Groovy7996Bug.groovy 
b/src/test/groovy/bugs/Groovy7996Bug.groovy
index d8ba632..cc6a3d0 100644
--- a/src/test/groovy/bugs/Groovy7996Bug.groovy
+++ b/src/test/groovy/bugs/Groovy7996Bug.groovy
@@ -46,4 +46,43 @@ class Groovy7996Bug extends GroovyTestCase {
             assert new Bar7996().doStuff()
         '''
     }
+
+    // GROOVY-7687
+    void testCompileStaticWithNestedClosuresBug() {
+        assertScript '''
+        @groovy.transform.CompileStatic
+        class BugTest {
+            static class Foo {
+                public List<String> messages = Arrays.asList("hello", "world")
+            }
+
+            void interactions(Foo foo, @DelegatesTo(Foo) Closure closure) {
+                closure.delegate = foo
+                closure()
+            }
+
+            void execute() {
+                interactions(new Foo()) {
+                    messages.each{ it.contains('o') }
+                }
+            }
+        }
+        new BugTest().execute()
+        '''
+    }
+
+    // GROOVY-8073
+    void testCompileStaticMapInsideWithBug() {
+        assertScript '''
+            @groovy.transform.CompileStatic
+            class Main {
+                static void main(String[] args) {
+                    def map = [a: 1, b: 2]
+                    map.with {
+                        assert a == 1
+                    }
+                }
+            }
+        '''
+    }
 }

Reply via email to