This changes that expression_suite tests to embed the needed source
code in the yaml file. Single source and multi sources are supported.
When using a single source, the file name is implicitly "main.dart"
and the "position" and "entry_point" yaml properties are updated to
supports this, meaning that the yaml files should only use file names
when using multiple sources.
Change-Id: Ia6756eb86a7b72dea2187f72b9f2c75c28783a0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237680
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This updates ast-to-text to show the annotations on import/exports. A
test is added that uses augmentation libraries to show that the
annotations are not currently ascribed to the correct library dependency.
Change-Id: I340c1ab920b16ff08dd9ac36ee9be4d2d651b4a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237301
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This implements TypeDeclarationResolver for the CFE. Adds a test to
the macro api test, which includes support for throwing and catching
the ArgumentError required by the api.
Change-Id: I5bb7948064ba5a2c215289915fc10314fd28aa1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237020
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds support for [interfacesOf] and [mixinsOf] of the
[ClassIntrospector] interface. To support this, the mixed in
[ClassHierarchyNode] is now included in the [ClassHierarchyNode] for
a mixin application.
Change-Id: I30cef4b462b1b2b52acf1bd286d82ebc1c5caa4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236883
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Redirecting factories are not allowed to declare default values but
should instead inherit the default values from their target. Since
the current encoding of redirecting factories is a callable function
used as the tear-off by the VM, the default values should be copied
to the procedure representing the redirecting factory.
Closes https://github.com/dart-lang/sdk/issues/48548
Change-Id: I0e601cd4920bc1059c9bf99e4a4c9c0e20c183e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237160
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This refactors ClassHierarchyNode to contain the [ClassHierarchNode]s of
its direct interfaces instead of the [TypeBuilder]s. This makes the
[ClassHierarchyNode] interface more self-contained and prepares for use
in macro introspection.
Change-Id: I4014ea180321060aceaf5cc88d5d2182a3c34d54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236881
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This moves macro implementation into its own subfolder and refactors
the IdentifierImpl implementation to be split into identifier based on
TypeDeclarationBuidler, TypeBuilder, MemberBuilder and
FormalParameterBuilder.
As part of the refactoring, the resolveTypeAnnotation implementation was
rewritten to use DartType instead of TypeBuilder.
Change-Id: Ie59160f4252627849606169b0210aaa83a27d60c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236880
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This is used by the modular compilers, so it unblocks more "real" blaze integration, and allows the language repo to create examples that you can actually run.
Note that this also actually enables macros when the experiment flag is passed in to this entrypoint.
Change-Id: Ia5ce82621a63363a17d16599fead5124ddf65faf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236340
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
This adds support for preserving reference in augmentations.
Augmentation libraries are now passed `referencesFrom` such that
its members case use it.
A special case is classes. Classes need the `referencesFrom` both
for themselves and for their members but while injected classes should
use the reference from `referencesFrom` for their [Class] node,
augmentation classes shouldn't. This is because [Class] node for the
origin is used in the output, whereas the augmentation [Member] node is
used for the members.
Change-Id: Iea73a5edd8f6cd4801e7e8229583eab69d89968e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236500
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The old code tries to determine something by using a forwarding listener
without forwarding to anything. It leaked a rewrite though, meaning that
the rewrite stayed, but the error given when rewriting wasn't passed on.
When then parsing it with the real listener, the rewrite was in effect
and there was no error to report. In total no errors were reported.
This fixes the issue by undoing any rewrites in this situation.
Fixes https://github.com/dart-lang/sdk/issues/47020
Change-Id: I5342ae6969f00dea830fb7abb30f21932907b8bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This changes tool/fasta.dart to run the subcommand in the same VM when
no VM arguments are specified. This speeds up the tool and as a
consequence speeds up the tool/update_all.dart and
tool/update_expectation.dart tools.
Change-Id: I80b61a692a3ac2e15a7d1d097e65e1efbf9e4aee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236560
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds support for changes to macro classes with the alternative
invalidation strategy. Because macro classes can modify code in any
library where they are applied, changes to libraries with macro classes,
or to libraries that they depend upon, are handled as a signature
change that require full recompilation of the dependencies.
A more precise approach would be to invalidate only the libraries that
apply the changed macros. This data is not currently available during
incremental compilation.
Change-Id: I23347e332b95acfe232f4a04a023677780a64d60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235681
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The type inference on enum elements was performed at the outline
expression building phase, which is later than the inference on the
rest of the members. It prevents some type checks from being performed
correctly, for example, a check for the type of the getter induced by
the element and a declared static setter. This CL moves the inference
on enum elements to the same phase as for the rest of the class and
enum members.
Part of https://github.com/dart-lang/sdk/issues/47453
Change-Id: Iefc5606e6db07df8cd2de101c47d115c2ff8454a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
This adds support for using multiple files in one incremental macro
tests. Tests are added for in body changes in class members and
macro class members. The latter needed support for invalidation of
precompiled macros.
Change-Id: Ib20814ccb3f15c76f6e2413643ae0a9e4ff79d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235660
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This adds formatting support for upcoming language features:
- Named arguments anywhere
- Enhanced enums
- "super." parameters
It doesn't change the formatting of any existing code, so it should be
safe to roll this in without coordinating a pre-built SDK roll.
I also went ahead and ran the formatter on the related language tests
since before now they couldn't be formatted. (And I incidentally ran
the formatter on the other enum tests sitting in the same directory.)
Edit: Actually there is one small change to existing formatting: enum
declarations will now get a blank line inserted before them. Most hand
authored enums already have this so will be unchanged but I see a few
diffs when formatting generated code.
Change-Id: Icefd9f10bedc589312396cf0ddb8eafc418f8dbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235284
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
This reorganize the handling of super initializers to support
experiments enhanced-enums and super-parameters being enabled
simultaneously. The change also handles non-const enum constructors
when enhanced-enums is not enabled and super initializers in
non-enum classes when enhanced-enums _is_ enabled.
Change-Id: I099736fa9dcd6747060e65c875ff0f3275e9506d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235021
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>