<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Correct and good catch! </div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Spec updated.</div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Many thanks <span id="🚀">🚀</span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Yuriy Maslyanko <yuriy.maslyanko@oracle.com><br>
<b>Sent:</b> 18 October 2023 23:38<br>
<b>To:</b> Angelos Bimpoudis <angelos.bimpoudis@oracle.com><br>
<b>Cc:</b> compiler-dev@openjdk.org <compiler-dev@openjdk.org><br>
<b>Subject:</b> JEP 455: JLS change for switch expressions</font>
<div> </div>
</div>
<style>
<!--
@font-face
{font-family:"Cambria Math"}
@font-face
{font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
{color:#0563C1;
text-decoration:underline}
code
{font-family:"Courier New"}
span.x_EmailStyle17
{font-family:"Calibri",sans-serif;
color:windowtext}
.x_MsoChpDefault
{}
@page WordSection1
{margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
{}
-->
</style>
<div lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal">Hi Angelos,</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">JCK team started working on JEP 455: Primitive types in Patterns, instanceof, and switch (Preview). Just noticed that in the draft spec,
<a href="https://cr.openjdk.org/~abimpoudis/instanceof/jep443-20231010/specs/instanceof-jls.html">
https://cr.openjdk.org/~abimpoudis/instanceof/jep443-20231010/specs/instanceof-jls.html</a>, there is a change for the switch statement:</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">14.11 The switch Statement</p>
<p class="x_MsoNormal">The <em><span style="font-family:"Calibri",sans-serif">Expression</span></em> is called the
<em><span style="font-family:"Calibri",sans-serif">selector expression</span></em>. The type of the selector expression must be
<code><span style="font-size:10.0pt">char</span></code>, <code><span style="font-size:10.0pt">byte</span></code>,
<code><span style="font-size:10.0pt">short</span></code>, <code><span style="font-size:10.0pt">int</span></code>, or a reference type, or a compile-time error occurs. (jls-14.11-200)</p>
<p class="x_MsoNormal">-></p>
<p class="x_MsoNormal">The <em><span style="font-family:"Calibri",sans-serif">Expression</span></em> is called the
<em><span style="font-family:"Calibri",sans-serif">selector expression</span></em>. The type of the selector expression
<strong><span style="font-family:"Calibri",sans-serif">can be either a primitive or a reference type.</span></strong></p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal"> </span></strong></p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal">But the corresponding assertion for switch expressions is not changed:</span></strong></p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal"> </span></strong></p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal">15.28. switch Expressions</span></strong></p>
<p class="x_MsoNormal">The <em><span style="font-family:"Calibri",sans-serif">Expression</span></em> is called the
<em><span style="font-family:"Calibri",sans-serif">selector expression</span></em>. The type of the selector expression must be
<code><span style="font-size:10.0pt">char</span></code>, <code><span style="font-size:10.0pt">byte</span></code>,
<code><span style="font-size:10.0pt">short</span></code>, <code><span style="font-size:10.0pt">int</span></code>, or a reference type, or a compile-time error occurs. (jls-15.28-200)</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal">Could you please take a look?</span></strong></p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal"> </span></strong></p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal">Thanks,</span></strong></p>
<p class="x_MsoNormal"><strong><span style="font-family:"Calibri",sans-serif; font-weight:normal">Yuriy</span></strong></p>
</div>
</div>
</body>
</html>