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

javac, fix diagnostic position for statement-bodied lambdas

    Details

    • Subcomponent:
    • Resolved In Build:
      b152
    • Verification:
      Verified

      Description

      Currently javac is generating the diagnostic position for the mentioned lambdas in this way:

      Test.java:17: error: incompatible types: bad return type in lambda expression
              foo((x) -> { return ""; System.out.println(""); });
                    ^

      The proposal is to show the position where the body starts:

      Test.java:17: error: lambda body is neither value nor void compatible
              foo((x) -> { return ""; System.out.println(""); });
                            ^

      reported at compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-November/009146.html

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: