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

anonymous class in explicit constructor invocation can refer implicitly to encl

    Details

    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      generic
    • OS:
      solaris_8

      Description

      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(); }
                          });
                  }
              }
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              gafter Neal Gafter
              Reporter:
              gafter Neal Gafter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: