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

Weird AST structure for incomplete member select

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b28

      Description

      Consider code like this:
      ---
      int i = "".
      @Deprecated void t() {}
      ---

      The AST for this will not include any sensible initializer, the initializer will be an erroneous node with no subnodes, and "@Deprecated" will be subsumed by the initializer as well. The errors are:
      ---
      /tmp/E.java:2: error: <identifier> expected
      int i = "".
                 ^
      /tmp/E.java:3: error: illegal start of expression
      @Deprecated void t() {}
      ^
      /tmp/E.java:3: error: ';' expected
      @Deprecated void t() {}
                 ^
      3 errors
      ----

      There is a relation to JDK-8253584.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: