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

Spurious unchecked cast warning

XMLWordPrintable

    • 5.0
    • 5.0
    • generic
    • solaris_8

      The following program is given an unchecked cast warning, but there should
      be no warning because the cast is statically known to be safe.

      class Main {
          <T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {
              return (z? (T) x1: x2);
          }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: