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

javac considers '?' equivalent to '? extends Foo'

XMLWordPrintable

      javac accepts the following code:

      import java.util.*;

      interface Foo {}

      interface Bar<T extends Foo> extends Comparable<Bar<?>> {
          Comparator<Bar<? extends Foo>> DATE_TIME_ORDER = null;
          Comparator<Bar<?>> date = DATE_TIME_ORDER; // this shouldn't be accepted
      }

      accepting this code implies that '?' is equal to '? extends Foo'

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: