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 c9d40f4  GROOVY-7856: Adding CompileStatic via compiler config script 
to class with eachWithIndex results in exception in instruction selection phase
c9d40f4 is described below

commit c9d40f4e2a78c3941f980f558ef2fd7c69f8f824
Author: Eric Milles <eric.mil...@thomsonreuters.com>
AuthorDate: Sat Mar 16 20:39:46 2019 +1000

    GROOVY-7856: Adding CompileStatic via compiler config script to class with 
eachWithIndex results in exception in instruction selection phase
    
    (pass through compilationUnit when needed)
---
 .../groovy/control/customizers/DelegatingCustomizer.java      | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/codehaus/groovy/control/customizers/DelegatingCustomizer.java
 
b/src/main/java/org/codehaus/groovy/control/customizers/DelegatingCustomizer.java
index 68e394a..d3d51e5 100644
--- 
a/src/main/java/org/codehaus/groovy/control/customizers/DelegatingCustomizer.java
+++ 
b/src/main/java/org/codehaus/groovy/control/customizers/DelegatingCustomizer.java
@@ -18,9 +18,11 @@
  */
 package org.codehaus.groovy.control.customizers;
 
+import groovy.transform.CompilationUnitAware;
 import org.codehaus.groovy.ast.ClassNode;
 import org.codehaus.groovy.classgen.GeneratorContext;
 import org.codehaus.groovy.control.CompilationFailedException;
+import org.codehaus.groovy.control.CompilationUnit;
 import org.codehaus.groovy.control.SourceUnit;
 
 /**
@@ -29,7 +31,7 @@ import org.codehaus.groovy.control.SourceUnit;
  *
  * @since 2.1.0
  */
-public abstract class DelegatingCustomizer extends CompilationCustomizer {
+public abstract class DelegatingCustomizer extends CompilationCustomizer 
implements CompilationUnitAware {
     protected final CompilationCustomizer delegate;
 
     public DelegatingCustomizer(CompilationCustomizer delegate) {
@@ -38,6 +40,13 @@ public abstract class DelegatingCustomizer extends 
CompilationCustomizer {
     }
 
     @Override
+    public void setCompilationUnit(final CompilationUnit compilationUnit) {
+        if (delegate instanceof CompilationUnitAware) {
+            ((CompilationUnitAware) 
delegate).setCompilationUnit(compilationUnit);
+        }
+    }
+
+    @Override
     public void call(final SourceUnit source, final GeneratorContext context, 
final ClassNode classNode) throws CompilationFailedException {
         delegate.call(source, context, classNode);
     }

Reply via email to