Details

      Description

      Consider source code like:
      public class DiagnosticPosition {

          public static void main(String[] args) {
              int i = args[0].
                      lengthX;
              int j = args[0].
                      length(1);
          }
      }

      Compiling this leads to:
      $ javac DiagnosticPosition.java
      DiagnosticPosition.java:4: error: cannot find symbol
              int i = args[0].
                             ^
        symbol: variable lengthX
        location: class String
      DiagnosticPosition.java:6: error: no suitable method found for length(int)
              int j = args[0].
                             ^
          method CharSequence.length() is not applicable
            (actual and formal argument lists differ in length)
          method String.length() is not applicable
            (actual and formal argument lists differ in length)
      2 errors

      The caret marker is not placed appropriately - it refers to the names that are not visible (as they are on the next line).

      This is with:
      $ javac -fullversion
      javac full version "1.8.0-b132"

        Attachments

          Activity

            People

            • Assignee:
              jlahoda Jan Lahoda
              Reporter:
              jlahoda Jan Lahoda
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: