On Apr 7, 2022, at 7:40 AM, Gavin Bierman 
<gavin.bier...@oracle.com<mailto:gavin.bier...@oracle.com>> wrote:

Dear experts:

The first draft of a spec covering both the third preview of Pattern Matching 
for switch (JEP number coming, but currently available at 
https://openjdk.java.net/jeps/8282272) and JEP 405 (Record Patterns) is now 
available at:

http://cr.openjdk.java.net/~gbierman/PatternSwitchPlusRecordPatterns/PatternSwitchPlusRecordPatterns-20220407/specs/patterns-switch-jls.html

Comments welcome!

Thanks,
Gavin

Also missing Oxford comma in first bullet of 6.3.2.6 switch Statements.

6.3.3.2 Record Pattern

The following rule applies to a record pattern p:

  *   For each pattern q in the record component pattern list of p, a pattern 
variable declared by q is definitely matched in the rest of record component 
pattern list.

It is a compile-time error if a pattern variable declared by q is already in 
scope somewhere in the rest of the record component pattern list.

Is the term “rest of the list” carefully defined elsewhere? Otherwise it could 
be misconstrued as “anywhere else in the list.

Perhaps:

• For each pattern q in the record component pattern list of p, a pattern 
variable declared by q is definitely matched in every record pattern component 
that comes after it within the list.

or

• For each pattern q in the record component pattern list of p, a pattern 
variable declared by q is definitely matched in every record pattern component 
that is to its right within the list.

and similarly for the next sentence (“It is a compile-time error . . .”).

Reply via email to