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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 8, 8-repo-lambda
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: