new wildcard subst scheme breaks java.lang.ref

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • 5.0
    • Affects Version/s: 5.0
    • Component/s: 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);
          }
      }

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: