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

@Delegate for class that implements interface with Generic Method causes VerifyError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.7, 2.4.0-beta-3
    • 2.4.0-rc-2
    • xforms
    • 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  
      

      Attachments

        1. generic-delegate.tgz
          50 kB
          John Engelman

        Activity

          People

            paulk Paul King
            johnrengelman John Engelman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: