Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4721003

anonymous class in explicit constructor invocation can refer implicitly to encl

XMLWordPrintable

    • mantis
    • generic
    • solaris_8

      See 15.9.5.1 for why it is explicitly allowed in the context of this test

      /*
       * @test @(#)SuperNew3.java 1.2 02/08/26
       * @bug 4432312 4721003
       * @summary compiler crash with assertion failure (inner classes)
       * @author gafter
       *
       * @compile SuperNew3.java
       */

      public class SuperNew3 {
          SuperNew3() {}
          SuperNew3(Object o) {}
          void foo() {
              class One extends SuperNew3 {}
              class Two extends SuperNew3 {
                  Two() {
                      super(new One() {
                              { new One(); }
                          });
                  }
              }
          }
      }

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: