Pattern Matching for instanceof (Preview 2)
forax at univ-mlv.fr
forax at univ-mlv.fr
Thu Feb 6 23:08:24 UTC 2020
----- Mail original -----
> De: "Brian Goetz" <brian.goetz at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "jan lahoda" <jan.lahoda at oracle.com>, "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Envoyé: Vendredi 7 Février 2020 00:00:40
> Objet: Re: Pattern Matching for instanceof (Preview 2)
>> var is not really any, it's an inferred type pattern.
>> '_' is any, no ?
>
> Conveniently, an inferred type pattern _is_ an any pattern. (See the
> explanation in the recent discussion on nullity, where this fell out
> nicely.) So semantically a var pattern is an any pattern.
not if there are multiple de-constructors with the same arity, right ?
> Whether or not we want an explicit any pattern is a separate question.
Rémi
More information about the amber-spec-observers
mailing list