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

javac should take multiple upper bounds into account in incorporation

XMLWordPrintable

    • b13

        This code:

        interface Task<E extends Exception> {}
        class Comparator<T> {}
        class CustomException extends Exception {}

        class TaskQueue<E extends Exception, T extends Task<E>> {}

        abstract class Test {
            abstract <E extends Exception, T extends Task<E>> TaskQueue<E, T> create(Comparator<? super T> comparator);

            void f(Comparator<Task<CustomException>> comp) {
                TaskQueue<CustomException, Task<CustomException>> queue = create(comp);
            }
        }

        compiles in 6 and 7 but fails to compile in 8.

        Reported on lambda-dev: http://mail.openjdk.java.net/pipermail/lambda-dev/2013-November/011442.html

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

                Created:
                Updated:
                Resolved: