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

Javac does not correctly implement wildcards removal from functional interfaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • None
    • tools
    • b99
    • Verified

      This program fails to compile:

      class Test {
          interface I<R extends Runnable, T> {
               void m();
          }

          {
              I<? extends O, String> succeed = this::ff; //ok
              I<? extends Comparable<String>, String> failed = this::ff; //error
          }

          interface O {}
          private void ff(){}
      }

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

              Created:
              Updated:
              Resolved: