Type test pattern with array type in switch fails to parse

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 27
    • Component/s: tools
    • None

      The following code fails to parse

      void testSwitch(Object o) {
              switch (o) {
                  case List<String>[] p -> { }
              };
      }

      Conversely, when using an instanceof, everything works

      void testInstanceof(Object o) {
              if (o instanceof List<String>[] p) { }
      }

      This seems an issue with JavacParser::analyzePattern

            Assignee:
            Angelos Bimpoudis
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: