Is case var(var x, var y) a valid syntax ?
brian.goetz at oracle.com
Mon Sep 7 16:55:41 UTC 2020
> I agree with Alan. While I believe that Rémi is correct insofar as you
> can write “var” in place of a type in any type pattern “T x”, in a
> deconstruction pattern “P(...) [d]” the occurrence of P is not a type;
> rather, it names a deconstructor.
> It does so happen that right now all deconstructors (like all
> constructors) share the name of an associated type, but it is
> important not to confuse them. You cannot replace a deconstructor name
> with “var” any more than you can write “new var()” or “new
or `new var` or `import var` or `Foo<var> = e`.
More information about the amber-spec-experts