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

Regression: creating class inside anonymous inner class featuring varargs constructor issues error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 7
    • 7
    • tools
    • unknown
    • generic

      This program doesn't compile:

      class Test {

      Test(String... args) { }

      public void test() {
      new Test() {
      void foo() { new java.io.Serializable() {}; };
      };
      }
      }

      Output from javac:

      TestX.java:21: error: internal error; cannot instantiate <anonymous Test$1$1>() at <anonymous Serializable> to ()
      void foo() { new java.io.Serializable() {}; };
      ^
      1 error

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: