Missing unchecked conversion warning

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • repo-amber
    • Affects Version/s: None
    • Component/s: tools
    • generic
    • generic

      This program should elicit an unchecked conversion warning, but does not:

      import java.util.ArrayList;

      public class X {
          public static void main(String [] args) {
              Object o = new ArrayList<X>();
      // if (o instanceof ArrayList<Integer>) { // illegal generic type for instanceof
      // System.out.println("Blah");
      // }
              if (o __matches ArrayList<Integer> ai) {
                  System.out.println("Blah");
              }
              switch (o) {
                  case ArrayList<Integer> ai:
                      System.out.println("ArrayList<Integer>");
                      break;
              }
          }
      }

            Assignee:
            Srikanth Adayapalam (Inactive)
            Reporter:
            Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: