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

Lambda Spec: Grammar for lambda expressions is ambiguous

XMLWordPrintable

    • Verified

      Because a lambda expressions is treated as a Primary, it can (grammatically) appear as the left operand to some binary expression; or (as intended) the operator and the right operand could be considered part of the lambda body.

      () -> x + 1

      (() -> x) + 1
      vs.
      () -> (x + 1)

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

              Created:
              Updated:
              Resolved: