Record Deconstruction causes bytecode error

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: None
    • Component/s: tools
    • None
    • b17

      public class Test {
          record Foo(Object first, Object second) {}

          public static void main(String[] args) {
              Foo myfoo = new Foo(42, "millis");

              switch (myfoo) {
                  case Foo(Integer d, String s) -> System.out.println("got integer and string: " + d + ", " + s);
                  case Foo(Object fs, Object sc) -> System.out.println("values: " + fs + ", " + sc);
              }
          }
      }

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

              Created:
              Updated:
              Resolved: