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

unnecessary warning with cast

XMLWordPrintable

    • generic
    • solaris_8

      The following cast is safe yet we give a warning:

      class X {
          interface CF<S> { }
          interface CG<T> { }
          static class CH<S, T> implements CF<S>, CG<T> { }
          interface CI<S> extends CF<S> { }
          interface CJ<T> extends CG<T> { }
          interface CK<S, T> extends CI<S>, CJ<T> { }
          void f() {
              Object o = (CH<String, Integer>) (CK<String, Integer>) null; // <<pass>> <<todo: cast-infer>>
          }
      }

            ahe Peter Ahe
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: