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

Declared bounds not considered when functional interface containing unbound wildcards is instantiated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8, 8-repo-lambda
    • tools
    • b82
    • Verified

      This should compile:

      interface SAM<X extends Number> {
          void m(X x);
      }

      class Test {
          SAM<?> s = (x)->{};
      }

      The spec EDR says that if the declared bound does not depend on any other type parameters, the declared bound should be used in place of the wildcard in the inferred target/descriptor type.

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

              Created:
              Updated:
              Resolved: