Pattern Matching and null references

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Aug 3 05:03:10 UTC 2017


Please also look here

http://mail.openjdk.java.net/pipermail/amber-spec-experts/2017-July/000053.html

Maurizio

On 02/08/17 19:26, Tagir Valeev wrote:
> Indeed, I forgot about null today. Even if hierarchy of
> Node/AddNode/NegNode/MulNode/IntNode is sealed, null case was not covered
> on the slide.
>
> Mike, some discussion could be found here: [1]. Check Brian answer [2] and
> followups.
>
> With best regards,
> Tagir Valeev.
>
> [1] http://mail.openjdk.java.net/pipermail/amber-dev/2017-July/001514.html
> [2] http://mail.openjdk.java.net/pipermail/amber-dev/2017-July/001517.html
>
> On Thu, Aug 3, 2017 at 8:12 AM, Mike Duigou <openjdk at duigou.org> wrote:
>
>> Reviewing the JEP 305 document and Brian's talk today at JVMLS I did not
>> find any examples of the intended handling of pattern matching with null
>> references. I would be happy if the answer was "Well, we are finally going
>> to provide non-nullable references and pattern matching only works with
>> those" but suspect that there is probably a different answer. I still find
>> the non-handling of null by enum-switch and String-switch to be unfortunate
>> warts and would like to see a better answer for pattern-matching switch.
>>
>> Cheers,
>>
>> Mike
>>



More information about the amber-dev mailing list