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
390 B
Plaintext
6 lines
390 B
Plaintext
f(x, y) => switch(x) { _ when y + () => 0 };
|
|
|
|
|
|
f[StringToken]([BeginToken]x[StringToken],[SimpleToken] y[StringToken])[SimpleToken] =>[SimpleToken] switch[KeywordToken]([BeginToken]x[StringToken])[SimpleToken] {[BeginToken] _[StringToken] when[KeywordToken] y[StringToken] +[SimpleToken] ([BeginToken])[SimpleToken] =>[SimpleToken] 0[StringToken] }[SimpleToken];[SimpleToken]
|
|
[SimpleToken]
|