This adds support for decorating named parameters in packages
that are imported by the package being migrated.
Change-Id: I1f803b28ad8fedcedca14421b391dc7ab879d05f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106682
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This is an API change, but it's non-breaking, because
ClassTypeAlias.declaredElement has always returned a ClassElement; its
return type simply didn't reflect that fact.
Change-Id: I45bcfe1b371953e86f9690b7727be89a835841a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106681
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Removes the recently-added base class to tests (which brought more with it than we needed - and caused issues on Windows) and adds in the flutter/meta packages using helpers (inc extracting the meta package to a new helper).
Re-enable skipped LSP refactor test
Change-Id: I62f8b3e300a776cae4fbd6d15deafb5b8970eef0
Change-Id: I165b9acf75a3ec9a91feb1730be2949eb4d5e5cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
Change-Id: I1d4fd85f15c16e74e4dfdf5a618de2a7f4f3ec9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Currently, the migration engine crashes when it visits the identifier
in the following directive:
import "dart:core" as one;
This updates the migration engine to skip directives when looking
for expressions and type annotations to be migrated.
Change-Id: I079263b13e5f4c75fbfe22fa06993e7a5d4f9c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106660
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This flag has been enabled since Dart 2.2.0.
Change-Id: I18e77e1659d4be1aaf06e1c2a6262ae9e8c7f922
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104760
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Before this CL we could both crash and add wrong metadata to "part"
nodes when a part defined other parts.
This CL fixes it by
a) Not resetting a counter so *every* part in a part will be out of
bounds when trying to reference it; and
b) Check if a part directive is in bounds and ignore it if it isn't
(an error should already have been issued).
Change-Id: I3d31f2577b2120df6461c9cc1002131dbee9dbbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106641
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Currently there's at least two issues:
* We can crash
* We can add metadata to things they weren't meant for
Change-Id: I4e277ea614ce9faa25b2bf1c5a16a5e877df225b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The library builders uri might not be correct as the problems can
originate in parts.
Fixes#36990
Change-Id: I1c39a31052b88013df38033a49b662ce5bb86aad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106083
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This fixes a bug where the AstBuilder fails
given a constructor of the form:
class C {
C() : super()[];
}
In the process, 2 buildInitializer methods were extracted from
the AstBuilder.endInitializers method.
Fix https://github.com/dart-lang/sdk/issues/37285
Change-Id: Icacf28b2ed0eff9b7168c97ee0c03d78e5fcd68b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This will make it easier to re-use the test infrastructure for some
other tests I plan to introduce in a follow-up CL.
Change-Id: I0a243f00f342674fe38274eb46e7c1e943817785
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106442
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Update the message_test to automatically create an example that wrappes
all already defined examples in a part.
For instance, if the example is
main.dart: main() { print("hello world"); }
create an additional example that is basically
main_wrapped.dart: part 'main.dart';
main.dart: part of 'main_wrapped.dart'; main() { print("hello world"); }
(as well as some additional comments to push any actual positions in the
main file ot of scope for valid positions in the wrapper file.
This doesn't work for everything, e.g. if the original main imports or
exports anything, the new test will fail. That's okay, the status file
has been updated accordingly.
The reason for adding it is that we currently have some bugs that causes
us to crash in situations like this, i.e. situations where a message is
coming from a position in a part where the same position doesn't exist
in the non-part file.
The status file has been updated for that too, although not in sorted order.
Change-Id: Ib67f85fca5e81e0b9e93cf2d79ab50c38cae4936
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106082
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This adds a --server option for specifying the analyis server snapshot
to be used when calculating fixes.
Change-Id: I0adc3148c030d23a9a62883d842851709cb78168
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106220
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Emit as-casts and type-checks.
The recipes and environments are dummy values, and there is no
propagation of type information, so the code is pretty terrible.
Change-Id: Iea8b7d7dddd4538187d88f12e9ed81439f74d0e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106428
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Use embedded names to keep the field names consistent.
Change-Id: Ic8986b38e4a30e9457221939c6512d0446fb32f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106203
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
We no longer need to keep pointers to the nullability nodes directly
in the ExpressionChecks data structure; we merely need to record which
edges, if unsatisfied, would require a check.
This allowed the tests using assertNullCheck to be clarified--they now
simply verify that the appropriate edge exists, and then pass that
edge to assertNullCheck to verify that the ExpressionChecks object
points to the appropriate edge.
Change-Id: Iaaee51d1f23ca6f86a2fbf0a15ded6a844b2811b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106383
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This paves the way for being able to explain to the user exactly why
the migration tool made any given nullability decision.
Change-Id: I553e4881fdb37b238a066fcfba7c21ae919d7d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This paves the way for a follow-up CL that will introduce a more
general notion of the "origin" of an edge (of which ExpressionChecks
will be just one kind of origin).
Change-Id: I76ee12679d881ef95a4ba17a224fe85ecf6b589f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
These are now represented as named functions. This will also help the
debug tools give more information.
Tested with three applications and adding the names caused a code size increases
of less than 1%.
|Total App JS size | Increase |
|------------------|----------|
| 24.7 MB | 0.06% |
| 242 MB | 0.14% |
| 327 MB | 0.19% |
Fixes: #37118
Change-Id: I89a259215ceb8b9e559a190dbd521c923d4c55c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105546
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
New versions of pedantic now offer imports to versioned includes. This will
allow us to update packages in the SDK independently when new lints are added in
future versions.
Issue: #37218
Change-Id: I43a4a9ba6730ed107a87f4060d47bb50d837de49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106184
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>