Constructor reference to non-reifiable array should be rejected

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8
    • Component/s: tools
    • b82
    • Verified

      This program should not compile:

      import java.util.ArrayList;
      import java.util.List;
      interface I {
              List<String> [] doit(int x);
      }
      public class X {
         I i1 = ArrayList<String>[]::new; // Compiles OK
         I i2 = List<String>[]::new; // Compiles OK
         List<String> [] ls = new ArrayList<String>[10]; // Error.
      }

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: