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

Allow targetBytecode to be set for GROOVY 2.4.x versions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.17
    • 2.4.18
    • None
    • None

    Description

      Create and compile java interface containing static method using JDK8

      public interface JavaInterface
      {
        static int doSmth()
        {
          return 42;
        }
      }
      

       javac JavaInterface.java

       

      Open groovyConsole (2.5.4), add folder where JavaInterface.class is located to classpath, check 'Enable indy compilation' and paste following script

       

      import groovy.transform.CompileStatic
      import static JavaInterface.doSmth
      
      @CompileStatic
      void doCall()
      {
        println doSmth()
      }
      

       

       

      Compile and Run the script in groovyConsole. The result is JVM verification failure:

      java.lang.VerifyError: Illegal type at constant pool entry 51 in class Caller
      Exception Details:
      Location:
      Caller.doCall()V @4: invokestatic
      Reason:
      Constant pool index 51 is invalid

      Best Regards

      Artsiom

       

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              artsiom.matronkin Artsiom Matronkin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: