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

Missing checkcast when casting to intersection type

    XMLWordPrintable

Details

    • b87
    • Verified

    Description

      The following program runs w/o exceptions:

      import java.util.*;

      class Test {
          public static void main(String[] args) {
              Runnable r = (List<?> & Runnable)new ArrayList<String>();
          }
      }

      Note that, if the types are swapped in the intersection, the program fails with CCE.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: