Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7764

Joint compilation does not work with AST-transformed Groovy

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.6
    • None
    • None

    Description

      When using AST transformations together with joint compilation the generated stubs don't mind the transformations, which may yield invalid classes, that javac will fail to compile.

      Example:

      [...]
      class GroovyTest implements Callable {
          @Delegate
          private final Callable c = { println "Hello World" }
      }
      

      will get compiled into the following stub:

      [...]
      public class GroovyTest
        extends java.lang.Object  implements
          java.util.concurrent.Callable,    groovy.lang.GroovyObject {
      ;
      public  groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;}
      public  void setMetaClass(groovy.lang.MetaClass mc) { }
      public  java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments) { return null;}
      public  java.lang.Object getProperty(java.lang.String property) { return null;}
      public  void setProperty(java.lang.String property, java.lang.Object value) { }
      }
      

      which claims to implement Callable, but lacks a call method.

      I don't know if this is specific to @Delegate, but noticed similar behaviour with @InheritConstructors.

      Attachments

        1. foo.zip
          54 kB
          O. Reißig

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oreissig O. Reißig
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: