This separates VariableDeclaration from Statement. VariableDeclaration no longer implements Statement and variable declared in a block or in a for-statement are now wrapped by a VariableStatement.
Currently there are two VariableStatement implementations; LegacyVariableStatement for variables in the current model, called LegacyVariable, and VariableInitialization for variables used in the new, still experimental, encoding that supports scope computation.
This CL is a step towards realigning the AST nodes to the new model in which each kind of variable has its own distinct subclass. (LocalVariable, PositionalParameter, NamedParameter, SyntheticVariable, etc.)
Note that it is not the intent to use VariableStatement in ForStatement going forward but that will be handled in a follow-up.
TEST=existing.
Change-Id: I5b309cd62c9b138f95b74fb054686edffa49a393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502681
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit was generated by the following steps:
- Manually change the SDK constraint in `pkg/front_end/pubspec.yaml`
- Run `gclient sync`
- Run `find pkg/front_end/benchmarks pkg/front_end/lib
pkg/front_end/presubmit_helper.dart
pkg/front_end/presubmit_helper_spawn.dart pkg/front_end/test
pkg/front_end/tool -iname '*.dart' | xargs
tools/sdks/dart-sdk/bin/dart format`
- Manually fix remaining long lines and add dead code ignore comments.
- Fix coverage by running `dart --enable-asserts
pkg/front_end/test/coverage_suite.dart --tasks=5
--add-and-remove-comments`
- Fix `pkg/front_end/test/coverage_merger/assert_message_auto_ignored`
by running `dart pkg/front_end/test/unit_test_suites.dart -p
pkg/front_end/test/coverage_merger/assert_message_auto_ignored
-DupdateExpectations=true`
The diff is large because the version bump causes the formatter to
switch into "tall mode".
Change-Id: I6a6a696410da8b168060acfe0e4d6e91e294c4f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447628
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds support for computing the qualified name for all extension and extension type members.
The `lowering_predicates_test.dart` is removed and testing is performed through `predicate_test.dart`.
Change-Id: I334bb85d48b6b1fd8fa01de6576f61168b3e96fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424443
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This CL enables the avoid_void_async lint in the CFE, makes the needed
changes and adds the missing `await` (because the lint
`unawaited_futures` doesn't react to void async methods).
Change-Id: Iffc1f173badd3c2d48356ee02e81a9aed492ce5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213481
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Adds helpers for extracting original name of a lowered late field, the
original initializer and the field used to hold the value of the lowered
field.
This helps backends to customize late field encoding while still using
the lowering provided by the cfe.
Change-Id: Ib42af539efad84a08a6e32acd29d2efaff129cd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178989
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Even when non-nullable is enabled by default, enabling the experiment
explicitly should result in the experiment release version (and not
the experiment enabled version) to be used for opting in.
For this change, the semantics of parseExperimentalFlags was change
to _not_ normalize the flags to a full mapping including default values.
For this reason all uses of such maps are renamed to
'explicitExperimentalFlags'.
Closes#43879
Change-Id: I0d0262e68ec1403549abcfd305ae3a4404fe93e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168654
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>