This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch GROOVY_2_5_X in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 15c6834edac59d86f81fcb09b1053beb0b2d1afb 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 + } + } + } + ''' + } }