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

new wildcard subst scheme breaks java.lang.ref

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 5.0
    • 5.0
    • tools
    • generic
    • solaris_8

      The new subst scheme breaks an idiom used in java.lang.ref. An isolated test case follows. This is perfectly typesafe, yet rejected, with

      enqueue(? extends Ref<? extends java.lang.Object>) in Q<? super T> cannot be applied to (Ref<T>)
              this.queue.enqueue(this);
              ^



      class Q<T> {
          void enqueue(Ref<? extends T> r) {
          }
      }

      class Ref<T> {
          Q<? super T> queue;

          void enqueue() {
              this.queue.enqueue(this);
          }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: