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>
6 lines
249 B
Plaintext
6 lines
249 B
Plaintext
f() => switch(() => 0) {};
|
|
|
|
|
|
f[StringToken]([BeginToken])[SimpleToken] =>[SimpleToken] switch[KeywordToken]([BeginToken]([BeginToken])[SimpleToken] =>[SimpleToken] 0[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken];[SimpleToken]
|
|
[SimpleToken]
|