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

Inconsitent stack height when using super

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • 1.0-RC-1
    • 1.1-beta-1
    • bytecode
    • None
    • Version 1.0-RC-2, JDK 1.5, Windows XP

    Description

      Error occures in groovy-1.0-RC-02, it did'nt occure in JSR6

      When calling 'groovy SuperError.groovy' I get the error:
      Caught: java.lang.VerifyError: (class: B, method: m signature: (Ljava/lang/Object;)V) Inconsistent stack height 1 != 0
      In the method call super.m(p1, 'called from B') the super keyword is not necessary, but it should'nt result in an error.

      Here is the code:
      ----------------------------------------
      // SuperError.groovy
      class SuperError extends GroovyTestCase {
      static void testSuperError()

      { new B().m('Call B.m') }

      }

      class A {
      void m(p1)

      { println 'A.m with parameter: ' + p1 }

      void m(p1, p2)

      { println 'A.m with parameters: ' + p1 + ', ' + p2 }

      }

      class B extends A {
      void m(p1)

      { if (p1) super.m(p1, 'called from B') /* This works (without if): super.m(p1, 'called from B') And this works too (without super) if (p1) m(p1, 'called from B') */ }

      }
      ----------------------------------------

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            blackdrag Jochen Theodorou
            tof Christof Vollrath
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment