<div dir="ltr"><div style="font-family:monospace" class="gmail_default">Hello Brian,<br><br>Thank you for your response!<br><br>> We considered this for byte (and short and int and<br>> long...), but having written a lot of switches over byte,<br>> I am not sure I've encountered one that enumerates all<br>> 255 cases. <br><br>Fair point.<br><br>> If and when we have range patterns (n..m), I think the<br>> story might be different.<br><br>Woah, that would be perfect! Yeah, if range patterns are coming down the pipe, I'm fine waiting for that before getting this.<br><br>Thank you for your time and help!<br>David Alayachew<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 25, 2023 at 8:08 PM Brian Goetz <<a href="mailto:brian.goetz@oracle.com">brian.goetz@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  
  <div>
    <font size="4"><font face="monospace">We considered this for byte
        (and short and int and long...), but having written a lot of
        switches over byte, I am not sure I've encountered one that
        enumerates all 255 cases.  <br>
        <br>
        If and when we have range patterns (n..m), I think the story
        might be different.  <br>
      </font></font><br>
    <div>On 9/25/2023 5:02 PM, David Alayachew
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div style="font-family:monospace" class="gmail_default"><br>
          Hello Amber Dev Team,<br>
          <br>
          I have a feature request to be included as part of JEP 455 --
          Primitive Patterns.<br>
          <br>
          > Since the boolean type (and its corresponding boxed type)<br>
          > has only two distinct values, a switch that lists both<br>
          > the true and false cases is considered exhaustive:<br>
          > <br>
          > boolean b = ...<br>
          > switch (b) {<br>
          >   case true -> ...<br>
          >   case false -> ...<br>
          >   // Alternatively: case true, false -> ...<br>
          > }<br>
          > <br>
          > It is a compile-time error for this switch to include a<br>
          > default clause.<br>
          <br>
          I formally request that this functionality be extended to the
          primitive type byte.<br>
          <br>
          Thank you for your time and help!<br>
          David Alayachew<br>
        </div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div>