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

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

    Details

    • Subcomponent:
    • Verification:
      Verified

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: