Files
sdk/pkg/analyzer/lib
Sam Rawlins cccc9f93b2 Analyzer: Fix representation of an arrow generator (illegal) function
Fixes https://github.com/dart-lang/sdk/issues/43665

A function like `foo() sync* => []` is illegal, but there is no _parse_
error, only a compile-time error. So the analyzer needs to be able to
represent this function accurately.

I think that without this fix, the formatter crashes trying to format
such a function.

Without this fix, a function like `foo() sync* => []` has a
FunctionElement with `isAsynchronous` true (because there _is_ a
modifier) and `isGenerator` false, because an arrow function cannot be
a generator. But these bool values lead to wrong errors being reported.

Change-Id: I1f7bda3696d04b437f6ea12491ca4aa19b893574
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-08-23 21:12:10 +00:00
..
2021-04-08 19:05:30 +00:00