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

An AIC cannot extend a non static inner class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.6, 2.0.0
    • 2.3.4
    • Compiler
    • None

    Description

      Groovy doesn't support anonymous inner classes if they extend a non static inner class. For example:

      class Outer {
          int outer() { 1 }
          abstract class Inner {
              abstract int inner()
          }
          int test() {
              Inner inner = new Inner() {
                  int inner() { outer() }
              }
              inner.inner()
          }
      }
      assert new Outer().test() == 1
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: