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

5.1.10: Lower-bounded wildcard sometimes maps to its bound in javac

XMLWordPrintable

      In javac, the capture of C<? super Object> is C<Object>, not C<CAP>. More generally, where the declaration-site upper bound is B, C<? super T> maps to C<T> if T = B (we could generalize this to B <: T, since well-formedness already requires that T <: B).

      This behavior is unspecified, but could be considered as an enhancement to JLS, since it is longstanding compiler behavior.

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: