Skip to content

Commit 3061f25

Browse files
committed
[patterns] Fix variable pattern example.
Fix #2794.
1 parent ef7102a commit 3061f25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

accepted/future-releases/0546-patterns/feature-specification.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,12 @@ occur as subpatterns of a destructuring pattern in order to capture a
493493
destructured value.
494494

495495
```dart
496-
var (a, b) = (1, 2);
496+
switch ((1, 2)) {
497+
case (var a, var b): ...
498+
}
497499
```
498500

499-
Here, `a` and `b` are variable patterns and end up bound to `1` and `2`,
501+
Here, `var a` and `var b` are variable patterns and end up bound to `1` and `2`,
500502
respectively.
501503

502504
The pattern may have a type annotation in order to only match values of the

0 commit comments

Comments
 (0)