I would be very surprised if that were valid. The inner vars are fine, of course. However, your outer one has not replaced a type, but a deconstructor reference, or whatever we're calling the opposite of a constructor. "Any object which can be deconstructed into two constituent objects" will surely not be a useful query very often, and I wouldn't expect the language to support it.
On Mon, Sep 7, 2020, 1:24 AM Remi Forax <fo...@univ-mlv.fr> wrote: > Just a question, > do we agree that the syntax below is valid ? > > Point point = ... > switch(point) { > case var(var x, var y): ... > } > > i.e. that var can be written everywhere there is a type in a Pattern. > > Rémi >