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

Crash involving return from inner switch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 23
    • None
    • tools
    • None
    • b16

          record R1() {}
          record R2() {}

          int test() {
              return switch (new R1()) {
                  case R1() -> {
                      return switch (new R2()) { // crashes, instead it should just be the error: attempt to return out of a switch expression
                          case R2() -> 1;
                      };
                  }
              };
          }

            abimpoudis Angelos Bimpoudis
            abimpoudis Angelos Bimpoudis
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: