<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="NL-BE" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi experts</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I wanted to say something about the NPE discussions that happened the last few days, but decided against it as I felt that my thoughts had already been brought up and thus my comment wouldn't really add anything new to the discussion. However
while checking on some things in the current proposed spec, I did come across the following wording that felt wrong</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In 14.30.2 Pattern Matching:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> If execution of the invocation of the accessor method completes abruptly for reason S, then pattern matching completes abruptly by throwing a MatchException with cause S.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Invocations can only complete by throwing exceptions, but using the catchall "completes abruptly for reason S" feels wrong to because the reason is not the "Exception V" that has been thrown, but is "throw with value V", and I can only
add "V" as a cause of an exception, not "throw with value V".</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">A better wording might be this (based on 12.4.2 number 11 in numbered list)</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">> If the execution of the invocation of the accessor method completes abruptly by throwing some exception E, then pattern matching completes abruptly by throwing a MatchException with cause E.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards</p>
<p class="MsoNormal">Robbe Pincket</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ps. I was also wondering if could get a response to my earlier question on this list</p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><b>From: </b><a href="mailto:gavin.bierman@oracle.com">Gavin Bierman</a><br>
<b>Sent: </b>woensdag 19 oktober 2022 0:23<br>
<b>To: </b><a href="mailto:amber-spec-experts@openjdk.java.net">amber-spec-experts</a><br>
<b>Subject: </b>Draft Spec for Fourth Preview of Pattern Matching for Switch (JEP 433) and Second Preview of Record Patterns (JEP 432) now available</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Dear experts:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The first draft of a joint spec covering JEP 433 (Fourth Preview of Pattern Matching for switch) and JEP 432 (Record Patterns) is available at:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><a href="https://cr.openjdk.java.net/~gbierman/jep432+433/latest">https://cr.openjdk.java.net/~gbierman/jep432+433/latest</a>
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This covers all the changes for these JEPs *apart* from the proposal to infer type arguments in patterns. This will be added and announced shortly.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Comments welcomed!<o:p></o:p></p>
</div>
<p class="MsoNormal">Gavin<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>