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

Erroneous exhaustivity check with boolean switch

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • tools
    • None
    • b08

      Currently javac erroneously does not accept the following switch:

      Boolean bool = null;
      var _ = switch (bool) {
      case null -> "nothing";
      case true -> "something true";
      case false -> "something false";
      };

            abimpoudis Angelos Bimpoudis
            abimpoudis Angelos Bimpoudis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: