Paul King created GROOVY-9309:
---------------------------------

             Summary: Allow targetBytecode to be set for GROOVY 2.4.x versions
                 Key: GROOVY-9309
                 URL: https://issues.apache.org/jira/browse/GROOVY-9309
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 2.5.4
            Reporter: Artsiom Matronkin
            Assignee: Eric Milles


Create and compile java interface containing static method using JDK8
{code:java}
public interface JavaInterface
{
  static int doSmth()
  {
    return 42;
  }
}
{code}
 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

 
{code}
import groovy.transform.CompileStatic
import static JavaInterface.doSmth

@CompileStatic
void doCall()
{
  println doSmth()
}
{code}
 

 

Compile and Run the script in groovyConsole. The result is JVM verification 
failure:
{noformat}
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{noformat}
Best Regards

Artsiom

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to