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

4.5.1: Clarify that ? <= ? extends Object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8
    • specification

      Per JDK-6480391 and its update to 4.5.1, "The wildcard ? extends Object is equivalent to the unbounded wildcard ?"

      This is a subtle point and easy to overlook in a system that represents these two wildcards differently, so JDK-6480391 also added the following rules for type argument containment:
      ? extends T <= ?
      ? super T <= ? extends Object

      Another rule should be added, also for clarity:
      ***? <= ? extends Object***

      (Note that 18.2.3 already includes a similar rule for inference involving type argument containment.)

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

              Created:
              Updated: