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

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

    Details

    • Subcomponent:
    • Resolved In Build:
      b123
    • CPU:
      unknown
    • OS:
      generic
    • Verification:
      Verified

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: