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

unsoundness in type-containment implementation

    XMLWordPrintable

Details

    • b99
    • unknown
    • generic
    • Verified

    Description

      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);
         }
      }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: