c2713ca752
If the parser gets lost during a switch expression, it now attempts to pick back up at the next `,` in between the curly braces (ignoring more deeply nested commas). This allows much better error recovery in the case where an illegal function expression appears in a guard. Fixes #51906. Bug: https://github.com/dart-lang/sdk/issues/51906 Change-Id: I1cb43857ccc04f0e4146c23c9e07acb02a80d405 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293083 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
5 lines
59 B
Dart
5 lines
59 B
Dart
f(x) => switch (x) {
|
|
_ when () => true => 1,
|
|
_ => 2
|
|
};
|