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

VerifyError With Inner Class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0, 2.4.0-beta-3
    • 3.0.0-rc-1, 2.5.13
    • Compiler
    • None

    Description

      The following code compiles but throws a VerifyError at runtime:

      Test.groovy
      class Test {
      
          static void main(String[] args) {
              def a = new A()
          }
      
          static class A {
              A() {
                  def b = new B()
              }
      
              void sayA() { println 'saying A' }
      
              class B extends A {
                  public B() {
                      super(A.this)
                      sayA()
                  }
              }
          }
      }
      

      I didn't go back through versions but I tested with 2.3.0 and that shows the problem.

      Caught: java.lang.VerifyError: (class: Test$A$B, method: <init> signature: (LTest$A;)V) Expecting to find object/array on stack
      java.lang.VerifyError: (class: Test$A$B, method: <init> signature: (LTest$A;)V) Expecting to find object/array on stack
      	at Test$A.<init>(Test.groovy:9)
      	at Test.main(Test.groovy:4)
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              brownj Jeff Brown
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m