<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;}
.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" style="word-wrap:break-word">
<div class="WordSection1">
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB">>> There is also a minor issue that looks like an overlook but refactoring an exhanced for from using a declaration to a record pattern is a little dangerous because if the iterable is null the semantics change, with
the record pattern it throws a MatchException instead of a NPE.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-GB">><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">> Yeah, it might make sense to special-case null here, though the
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">> MatchException has to stay in the general case of "looked exhaustive at
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">> compile time, but wasn't at run time."<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I'm quite confused here. I don't see any mention of foreach throwing an
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">MatchException instead of NPE when the iterable is null.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">I also don't understand the reasoning for making the foreach throw a<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">MatchException when one of the items is null instead of a simple NPE.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Regards<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Robbe Pincket<o:p></o:p></span></p>
</div>
</body>
</html>