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

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

    Details

      Description

      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'

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: