Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.7, 2.4.0-beta-3
-
None
-
JDK 1.80
JDK 1.7.0_60
Mac OS X
Description
Using the @Delegate annotation on a class that implements an interface where the interface defines a generic method causes a runtime VerifyError.
This occurs regardless of the interface being defined in Java or Groovy.
Additionally it does not occur if the @Delegate instance does not implement an interface while still defining the same method.
Attached an example project that exhibits the error when trying to run Spock tests using './gradlew test'
java.lang.VerifyError: Bad return type Exception Details: Location: foo/FooSpec.get(Ljava/lang/Class;)Ljava/lang/Throwable; @5: areturn Reason: Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/lang/Throwable' (from method signature) Current Frame: bci: @5 flags: { } locals: { 'foo/FooSpec', 'java/lang/Class' } stack: { 'java/lang/Object' } Bytecode: 0000000: 2a2b b601 07b0