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

unsoundness in type-containment implementation

XMLWordPrintable

    • b99
    • unknown
    • generic
    • Verified

      The following program does not compile with javac - but is accepted by Eclipse

      interface Foo<X extends Comparable<X>> {
         List<X> getList();
      }

      class Test {
         <T extends Comparable<? super T>> List<T> m(List<T> arg) { return null; }
       
         void test(Foo<?> foo) {
            m(foo.getList()).get(0);
         }
      }

            dlsmith Dan Smith
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: