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

Migration compatibility: can't call generic method

XMLWordPrintable

    • 5.0
    • generic
    • generic

      This program doesn't compile:

      interface Collection<E> {}
      interface Foo<X> {}
      interface Bar extends Foo { // notice Foo is raw!!!
      }
      class Baz<R,D> {
          public R visit(Collection<? extends Foo<?>> trees, D d) {
      return null;
          }
          R test(Collection<Bar> c, D d) {
      return visit(c, d); // visit(Collection<? extends Foo<?>>,D) cannot
                                  // be applied
          }
      }

      ###@###.### 2005-2-08 10:12:50 GMT

            ahe Peter Ahe
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: