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

Error message from lambda body missing line number

    Details

      Description

      When I compile the following, the line number for the error in the lambda body is left out of the error message.

      -----
      public class HiddenLine {

          void m(String s1) {}

          static class Nested {
              void m2(Number n) {
                  Runnable r = () -> m(n);
              }
          }

      }

      -----
      error: incompatible types: Number cannot be converted to String
      Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
      1 error

      I can get the desired information using -Xdiags:verbose:

      -----
      HiddenLine.java:7: error: method m in class HiddenLine cannot be applied to given types;
                  Runnable r = () -> m(n);
                                     ^
        required: String
        found: Number
        reason: argument mismatch; Number cannot be converted to String
      1 error

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pgovereau Paul Govereau (Inactive)
                Reporter:
                dlsmith Dan Smith
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: