Scope.forEach iterates through the builder immediately mapped in the
scope. For duplicate declarations, this means that it'll give direct access to the last defined declaration and not to the first defined
declaration, which is inconsistent with how we generally handle
duplications. It also doesn't skip builders that are not "owned" by
the scope but merely accessible, which means that we easily have
duplicate handling of patches and augmentations which are part of
both the scope in which the were declared and the scope of the origin.
To normalize the handle of scope, this CL removes Scope.forEach
with iterators that explicit filter what subset of the builder
that we want to have access to. This prepares for the more complex
scope introduced by the augmentation libraries in which all
scopes have access to all declarations from the origin library as
well as other augmentation libraries.
Change-Id: I88bdfb1068fbb4eb9dd6fa3881b86a61104e50e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255240
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This CL add support for introspecting members added in Phase 2 from
one macro application to the next.
Included is a refactoring of the class/member patching where the
origin now owns the patches similar to how library patching now
works.
Change-Id: Ifdf03461d66be3f5a5df4b5bdb1e3da9f4cfd688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233462
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This change adds a SourceMemberBuilderImpl subclass to MemberBuilderImpl
that use common only to SourceMemberBuilders. This allows moving methods
to the SourceMemberBuilder interface and let the
SyntheticConstructorBuilder, and the newly added
_RedirectingConstructorsFieldBuilder implements SourceMemberBuilder.
Change-Id: I1c98a61482bda3bea5be95124f34b9c4501e9333
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225726
Reviewed-by: Chloe Stefantsova <cstefantsova@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>
In each library where an import is removed, the library uses some elements
provided by the import, BUT there is another import which provides all of the
same elements, and at least one more which the library uses.
In this change, we remove the imports which can be simply removed in favor of
the other already present imports.
See https://github.com/dart-lang/sdk/issues/44569 for more information.
Change-Id: Iea21ddba3f26637a244437911730253e4c6f22dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199460
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@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>
This CL embeds the sdk_nnbd/lib/_internal/allowed_experiments.json
into the CFE and uses this to allow experiments enabled on a
per library basis. The file is embedded through generated code to
avoid reliance on access to the file itself.
A presubmit check is also added to ensure that the json file and
the generated code are in sync.
This work is in preparation for https://github.com/dart-lang/sdk/issues/41538
Change-Id: Ic03c0fc69684d124c685f2fe6e80423a7e751530
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149064
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>