<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<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 class="moz-cite-prefix">On 9/25/2023 5:02 PM, David Alayachew
wrote:<br>
</div>
<blockquote type="cite" cite="mid:CAA9v-_PpwC73=1L8Jqo7J0YkGXyp5PQ4fAb7xiedZS=WiFkAGg@mail.gmail.com">
<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>
</body>
</html>