You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Felix ter Beek (Jira)" <ji...@apache.org> on 2021/02/12 17:25:00 UTC

[jira] [Created] (GROOVY-9938) VerifyError when instantiating class with @CompileStatic that implements a method with @DelegatesTo annotation.

Felix ter Beek created GROOVY-9938:
--------------------------------------

             Summary: VerifyError when instantiating class with @CompileStatic that implements a method with @DelegatesTo annotation.
                 Key: GROOVY-9938
                 URL: https://issues.apache.org/jira/browse/GROOVY-9938
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 3.0.7, 2.5.6
         Environment: Windows 10
            Reporter: Felix ter Beek
         Attachments: script.groovy

Please see the script in the attachment for a minimal code sample to reproduce this issue.

This issue occurs both when implementing a trait, or when implementing an interface and using @Delegate to provide the implementation of the interface. Writing the implementation directly in the class works fine.

When I take out either @CompileStatic or @DelegatesTo the issue disappears.

 

stacktrace (groovy 3.0.7, using a trait (first example in script)):

ERROR java.lang.VerifyError:
Bad type on operand stack
Exception Details:
 Location:
 P$C.P$Ttrait$super$stuff(Lgroovy/lang/Closure;)V @8: invokevirtual
 Reason:
 Type 'P$C' (current frame, stack[0]) is not assignable to 'groovy/lang/Closure'
 Current Frame:
 bci: @8
 flags: \{ }
 locals: \{ 'P$C', 'groovy/lang/Closure' }
 stack: \{ 'P$C' }
 Bytecode:
 0000000: 2ac1 003c 9900 232a b600 42c0 000d b900
 0000010: 4501 0012 4604 bd00 0459 032b 53b8 004c
 0000020: c000 4e57 a700 1712 042a 1246 c000 5004
 0000030: bd00 0459 032b 53b8 0056 57b1
 Stackmap Table:
 same_frame(@39)
 same_frame(@59)

at P.run (groovysh_evaluate:13)
 at P$run.call (Unknown Source)



 

 

stacktrace (groovy 3.0.7, using @Delegate (second example in script)):

ERROR java.lang.VerifyError:
Bad type on operand stack
Exception Details:
 Location:
 P2$C.stuff(Lgroovy/lang/Closure;)V @1: invokevirtual
 Reason:
 Type 'P2$C' (current frame, stack[0]) is not assignable to 'groovy/lang/Closure'
 Current Frame:
 bci: @1
 flags: \{ }
 locals: \{ 'P2$C', 'groovy/lang/Closure' }
 stack: \{ 'P2$C' }
 Bytecode:
 0000000: 2ab6 002f c000 0b2b b600 3101 57b1

at P2.run (groovysh_evaluate:19)
 at P2$run.call (Unknown Source)



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