Draft Spec for Fourth Preview of Pattern Matching for Switch (JEP 433) and Second Preview of Record Patterns (JEP 432) now available

Dan Smith daniel.smith at oracle.com
Thu Oct 27 21:51:23 UTC 2022


> On Oct 22, 2022, at 2:52 PM, forax at univ-mlv.fr wrote:
> 
> If i modify a record by adding a new component, i want to compiler to help me to find all the switches that are using that record so i can re-evaulate if the new component play a role or not for each of those codes.

Maybe I'm missing something, but doesn't it do this already?

"The length of record component pattern list must be the same as the length of the record component list in the declaration of the record class named by ReferenceType; otherwise a compile-time error occurs." (14.30.1)

It would be one thing if you want runtime checks, but you're just saying you want a compiler error, right?



More information about the amber-spec-observers mailing list