b0c705e4bd
We need to prohibit function expressions during guard clauses in switch expressions, otherwise the `=>` might be misinterpreted. Fixes #50591. Bug: https://github.com/dart-lang/sdk/issues/50591, https://github.com/dart-lang/language/issues/2672 Change-Id: Ie5703ac7049557798b19778281429e8a591cf09f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273020 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
7 lines
72 B
Dart
7 lines
72 B
Dart
f(x, y) {
|
|
switch(x) {
|
|
case _ when y + () => 0:
|
|
break;
|
|
}
|
|
}
|