> De: "Brian Goetz" <brian.go...@oracle.com> > Cc: "amber-spec-experts" <amber-spec-experts@openjdk.java.net> > Envoyé: Vendredi 22 Janvier 2021 18:27:25 > Objet: Re: Relaxed assignment conversions for sealed types
> I want to pick up on this thread, now that we may have some more fire to add > to > it, and we've all had some time to think about it. [...] > I think these things are the same feature. So what if: > total-switch (x) { ... } // or switch-total > meant "I assert this switch is total, please error if it is not." Just from a pure syntax POV, i wonder if switch(total x) { ... } is not more in line with the other usages. It's just a trick but it looks more like a keyword that a special switch. [...] > And > case Foo(total Bar x) > meant "I assert that this nested pattern is total, please error if not." > In all cases, this doesn't change the semantics, it doesn't *make* anything > total -- it just provides a way to capture the design intent in a way the > compiler can type-check it. +1 for me. Rémi