Skip to content

Commit c0ec472

Browse files
committed
Clean up record type grammar.
There are no deliberate changes to what is expressible (except that the previous grammar inadvertently did not allow nullable record types). Fix #2511.
1 parent 7457b15 commit c0ec472

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

accepted/future-releases/records/records-feature-specification.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,8 @@ The grammar is:
170170

171171
```
172172
// Existing rules:
173-
type ::= functionType '?'? // Existing production.
174-
| recordType // New production.
175-
| typeNotFunction // Existing production.
176-
177173
typeNotFunction ::= 'void' // Existing production.
178-
| recordType // New production.
174+
| recordType '?'? // New production.
179175
| typeNotVoidNotFunction // Existing production.
180176
181177
// New rules:
@@ -188,8 +184,7 @@ recordTypeField ::= metadata type identifier?
188184
189185
recordTypeNamedFields ::= '{' recordTypeNamedField
190186
( ',' recordTypeNamedField )* ','? '}'
191-
recordTypeNamedField ::= type identifier
192-
recordTypeNamedField ::= metadata typedIdentifier
187+
recordTypeNamedField ::= metadata type identifier
193188
```
194189

195190
*The grammar is exactly the same as `parameterTypeList` in function types but

0 commit comments

Comments
 (0)