File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
accepted/future-releases/0546-patterns Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -602,7 +602,7 @@ rest element with no subpattern as a *non-matching rest element*.
602
602
### Map pattern
603
603
604
604
```
605
- mapPattern ::= typeArguments? '{' mapPatternEntries? '}'
605
+ mapPattern ::= typeArguments? '{' mapPatternEntries '}'
606
606
mapPatternEntries ::= mapPatternEntry ( ',' mapPatternEntry )* ','?
607
607
mapPatternEntry ::= expression ':' pattern
608
608
```
@@ -621,6 +621,9 @@ It is a compile-time error if:
621
621
expressions in a future release without it being a breaking change, similar
622
622
to default values in parameter lists.*
623
623
624
+ * Note that ` mapPatternEntries ` is not optional, which means it is an error for
625
+ a map pattern to be empty.*
626
+
624
627
* Note that we don't require map keys to have primitive equality, to enable
625
628
more flexibility in key types.*
626
629
You can’t perform that action at this time.
0 commit comments