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

Calling outer class method inside "super" call in constructor fails with static compilation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.3.2
    • None
    • None

    Description

      The following code fails with a VerifyError:

      class Parent {
              String str
              Parent(String s) { str = s }
          }
         @CompileStatic
          class Outer {
              String a
      
              private class Inner extends Parent {
                 Inner() { super(getA()) }
              }
      
              String test() { new Inner().str }
          }
          def o = new Outer(a:'ok')
          assert o.test() == 'ok'
      

      Note that this also fails, for a different reason, without @CompileStatic.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: