Parser support was enabled a long time ago (under a flag;
52892f7c47).
Enabling it would crash fasta though. This CL stops that from happening
and instead creates code that seems to work.
Change-Id: Ibe9735bd428104371ab34a1be08838988079220c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97621
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Dart interfaces can contain private member names that aren't accessible
in the current library. This is represented in Kernel as a stub that
throws (similar to the stubs used when noSuchMethod is present on a
class, typically used for mocks). DDC's Kernel backend did not
understsand that private members could belong to a different library.
This CL addresses it.
Note, this fix does not fix private names across modules. That is
covered by issue #36252 and will be addressed on top of this fix.
Change-Id: Id77d5de15d8d7ec5e44fc0f1264ced5e786636ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97441
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Also fix getNotPotentiallyConstants() to allow parameters of const
constructors in constructor initializers.
I'n not sure about using new CompileTimeErrorCode.NOT_POTENTIAL_CONSTANT,
it could be generic INVALID_CONSTANT, and report for constant literal
elements errors like NON_CONSTANT_LIST_ELEMENT, or NON_CONSTANT_MAP_KEY.
So, a bit inconsistency maybe, but we give more specific errors.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I88d8db77f7e5521e03e623cc26171a70599ba614
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97522
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
By indexing all sources in a concatenated dill file and then using that
index to find the sources and line starts we can fix missing information
(leading to crashes when collecting coverage) in for instance circular
instances.
Change-Id: I454cff57f84f21de72f6486e1cecf15d1389a498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96901
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This CL adds a test where:
* Two libraries depend on each other and both have mixins where
the body comes from the other file.
* The two-library component is then split into two one-library
components and loaded by the VM via the "multiple kernels"
functionality (basically as a concatenated dill file).
(Notice, that each individual component has a reference
(but no line starts or source), to the other library in its
uriToSource table. This currently causes the VM to let (at least)
one script have an empty source and and an empty line starts table.)
* The test then checks that it via the service protocol can find
a) a non-null, non-empty "tokenPosTable" for each script,
b) a translation between token positions and line-column via the
tokenPosTable for each token position the VM specifies as a
hit, a miss etc.
Said another way, it basically checks if we can collect coverage.
The test is currently skipped because it fails and we can't -
to my knowledge - mark it as such.
Change-Id: I76a049bffdd554755372a19235bf0c270bad3764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96103
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This CL removes the sources from uriToSource for libraries
the incremental compiler doesn't keep around.
This includes:
* Explicitly invalidated libraries, also if in a package.
* Transitively invalidated libraries, also if in a package.
* Libraries that are now no longer referenced in the resulting whole
program, unless it's in a package.
* Libraries from packages that are implicitly invalidated by an
updated .packages file (e.g. if the .packages file no longer
reference it or reference a new version of it).
This does *NOT* include:
* Libraries from packages that are not invalidated and that are still
mentioned in .packages, even if the actual libraries are no longer
referenced in the resulting whole program. The reason is that these
libraries are kept around in the incremental compiler.
Bug: 36197
Change-Id: I0ed41567ab54828585326ffd4dcb3722980bf874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97201
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
It looks like this code was implemented in the wrong place. At some
point reading the code (possibly during Kernel backend port), I noticed
this and left a TODO. This CL implements the solution described in it.
Change-Id: Iff837d471c87ec2fdb8f1a9a4afdb025af1a726f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97262
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
The AST refactor for "UI as code" left behind a few things whose names
ended in "2". This CL deprecates those things and creates
replacements that don't end in "2", so that we keep the API clean. In
a future breaking change release of the analyzer we'll remove the
deprecated things.
The following methods and classes are added:
- ForStatement and ForStatementImpl
- ListLiteral.elements
- SetOrMapLiteral.elements
- AstVisitor.visitForStatement
- AstFactory.forStatement
- NodeLintRegistry.addForStatement
The following methods and classes are deprecated:
- ForStatement2 and ForStatement2Impl
- ListLiteral.elements2
- SetOrMapLiteral.elements2
- AstVisitor.visitForStatement2
- AstFactory.forStatement2
- NodeLintRegistry.addForStatement2
In a similar way to how we did the previous stage of AST migration,
the existing visitors have been modified so that the default
implementation of visitForStatement2 redirects to visitForStatement;
this allows clients to change their overrides of visitForStatement2 to
override visitForStatement instead. Once all clients have been
migrated we will be able to delete the visitForStatement2 method.
Change-Id: Ife5949071fe4cb50791cd4f2f4b99a1bfaad54c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is a breaking change, however clients that switched to using
`Expression.precedence2` (which was introduced in analyzer release
0.35.3) are unaffected. After this change, clients may switch back to
using `Expression.precedence`.
Change-Id: Ia952c44001bdea91d32082add0be7e10c9936181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There is nothing constructing a `ConstantUse` through any path with a
use kind of `Indirect`.
- Remove the kind field and the only place reading it. Treat it as
always `DIRECT`.
- Remove the unused `mirrors` and `typeVariableMirror` constructors.
- Preserve other named constructors even though they behave identically to avoid
losing context at use sites.
- Make the `hashCode` getter lazy since it is only forwarding to the `value`.
Change-Id: I69a36fac245c74794b65e617b8cdd445a937bbee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97343
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The new formulation allows easy popping of variables when leaving
nested scopes. This should make it easier to support "for" collection
elements that declare variables.
Change-Id: Ib1a3f5085287573de99298eca772ce631837fc04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97287
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Remove instrumentation for diagnostic messages, forwarding stubs and
covariance, since all this information is present in the expectation
files already.
Change-Id: Idf6622f7eddba801761e13666b470ae6dcc9d59b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97106
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This constitutes a breaking change, so the analyzer major version
number is bumped to 36. Clients that have stopped using the removed
data structures (and the methods associated with them) should be
unaffected.
Change-Id: Iab68ecf8d10a13013ebb6b1198c54755225d0eb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95704
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>