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

Regression: compiler accepts invalid cast from X[] to primitive array

XMLWordPrintable

    • b123
    • unknown
    • generic
    • Verified

      This program should be rejected:

      class Test<X> {
          Object o = (byte[])(X[])null;
      }

      Instead, the compiler accepts it, starting from JDK 7 b112. The problem is likely to be related to the changes in cats conversion involving 292 (see 6979683).

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: