----- Original Message ----- > From: "Brian Goetz" <brian.go...@oracle.com> > To: "Remi Forax" <fo...@univ-mlv.fr>, "Gavin Bierman" > <gavin.bier...@oracle.com> > Cc: "amber-spec-experts" <amber-spec-experts@openjdk.java.net> > Sent: Thursday, February 10, 2022 6:12:51 PM > Subject: Re: [External] : Re: JEP 405 update
>>> That’s really what I am getting at. In that sense, record patterns are a >>> key, >>> because they >>> support nesting of patterns. You are correct that the construct within >>> which we >>> surface pattern matching can have a say in the top-level treatment of null. >> It's not what i've said, the treatment of null is due to the fact that a type >> pattern (at least the non total one) is semantically an instanceof thus >> reject >> null. > > We have been over this over and over again. This is not right, and you > are confusing people. I think you misunderstood me, it's my fault i've used the term "reject" instead of "not match", i was not talking about NPE here but the fact that both non total type pattern and record pattern does not match null. The fact that the switch can throw a NPE or not is a property of the record pattern, that was my point. Rémi