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

Correctly implement non-wildcard parameterization of a functional interface

    XMLWordPrintable

    Details

      Description

      9.9 claims that if a functional interface type has a wildcard where the corresponding type parameter bound mentions one of the class's type parameters, the function type is undefined.

      javac does some unspecified extra work to try to satisfy the bound. This should not happen.

      Example:


      interface I<T, S extends X<T>> {
         T foo(S p);
      }

      public class X<T> {
         public void bar() {
          I<Object, ? extends X<Object>> f = (p) -> p;
         }
      }

      Reported by Stephan Hermann to lambda-spec-experts@openjdk.java.net.

        Attachments

          Activity

            People

            Assignee:
            vromero Vicente Arturo Romero Zaldivar
            Reporter:
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: