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

Lambda Spec: Target function type of a lambda expression cannot be generic

XMLWordPrintable

    • Verified

      This should be an error (the lambda expression is not compatible with the target type):

      interface I { <T> void m(); }
      I i = () -> System.out.println("hi");

      But there is no rule in 15.27.3 to prevent it.

      javac reports an error.

            dlsmith Dan Smith
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: