JEP 443: semantics of "case _" vs "case null, default"

Remi Forax forax at univ-mlv.fr
Wed May 17 12:33:29 UTC 2023


Hello, all,
I've reread the JEP 443,
  https://cr.openjdk.org/~abimpoudis/unnamed/jep443-20230322/specs/unnamed-jls.html

First, a minor nit, at the end of the section 14.30.1, there is this sentence that reference the section 14.30.1 !
  "An unnamed pattern is always null-matching (14.30.1)."

My brain, stackoverflowed on that :)

And now a question, with the introduction of the unnamed pattern, in a switch, "case _" and "case null, default" have the same semantics,
given that "case null, default" is a kind of a hack, should we still allow it ?

regards,
Rémi


More information about the amber-spec-experts mailing list