Binding patterns with inferred type have erroneous node in the AST

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 23
    • Affects Version/s: 23
    • Component/s: tools
    • None
    • b26

      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.

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

              Created:
              Updated:
              Resolved: