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

Binding patterns with inferred type have erroneous node in the AST

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 23
    • 23
    • tools
    • None
    • b26

    Description

      Consider code like:
      ---
      public class Test {
          record R(int i) {}
          int test(Object o) {
              return switch (o) {
                  case R(var v) -> 0;
                  default -> 0;
              };
          }
      }
      ---

      javac compiles it without problems, but the type of "var v" in the AST is an Erroneous tree node, not a PrimitiveTypeTree, as could be expected.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: