[External] : Re: Primitive type patterns

forax at univ-mlv.fr forax at univ-mlv.fr
Fri Mar 4 00:41:06 UTC 2022


----- Original Message -----
> From: "Brian Goetz" <brian.goetz at oracle.com>
> To: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "amber-spec-experts" <amber-spec-experts at openjdk.java.net>
> Sent: Wednesday, March 2, 2022 9:11:58 PM
> Subject: Re: [External] : Re: Primitive type patterns

> On 3/2/2022 2:36 PM, forax at univ-mlv.fr wrote:
> 
>> There are two ways to express "match non null Integer + unboxing",
>> this one
>>    Integer value = ...
>>    switch(value) {
>>      case Integer(int i) -> ...
>>    }
>>
>> And we already agree that we want that syntax.
> 
> Wait, what?  The above is not yet on the table; we will have to wait for
> deconstruction patterns on classes to be able to express that. When we
> get there, we'll have a choice of whether we want to add a deconstructor
> to the wrapper classes.  (At which point, you might well say "we already
> have a way to do that"...)

It's a bad faith argument, we know since the beginning that we need deconstructors.

Rémi


More information about the amber-spec-observers mailing list