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

Inference doesn't report error on incompatible upper bounds

    XMLWordPrintable

Details

    • b17
    • Verified

    Description

      the example below compiles successfully on JDK8b132, but it seems to me that it should fail according to spec.

          class Container<U> {
              U t;
          }

          interface Supertype<U> {
          }

          interface Type1 extends Supertype<Number> {
          }

          interface Type2 extends Supertype<Integer> {
          }

          public class Main {
              static <U extends Type1> void m(Container<? super U> a) {
              }

              public static void main(String[] args) {
                  m(new Container<Type2>());
              }
          }

      Attachments

        Issue Links

          Activity

            People

              mcimadamore Maurizio Cimadamore
              mcimadamore Maurizio Cimadamore
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: