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>
DDC code generator copies these lists using toList(), so inherits
their reified types, and then fails to add a PropertyAccessorMember,
which is not an Impl.
R=brianwilkerson@google.com
Change-Id: Id26ef7bcea07b9956ebf7487883fbbf9f92cf7ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
AssertionError does not print on the console its message, at least in
IntelliJ. Also tweak tests to use throwsStateError.
R=brianwilkerson@google.com
Change-Id: Ifbe2ed0b1d3deba1feaecc7c462f470e8608b70c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106204
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This fixes NonNullOptOutTest.test_nnbd_optOut_late with summary2.
R=brianwilkerson@google.com
Change-Id: I9939ca92daaed349491df3463394164ead5d626b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106205
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
In follow-up CLs this should allow us to simplify the generation of
fixes (since each fix is associated with one or more unsatisfied
edges) and to streamline tests.
Change-Id: I997f704aac41f270756adcdf8d382fb2263273eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
- Run dartfmt --fix. This converts JavaDoc comments to "///", removes
"new" and extraneous "const", and a couple of other things.
- Fix SCREAMING_CAPS constants to lowerCamelCase.
- Use collection literals where possible.
- Use UI-as-code in a couple of places where it seemed obvious.
- Use "var" for more local variables.
- Use "const" instead of "final" when possible.
- Make members private when possible. Deleted a few that then became
obviously unused.
- ".length > 0" -> ".isNotEmpty".
There are no meaningful changes.
Change-Id: Ic6c5a74b2af9b3ebcbe881dbed69f65488bdef09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105880
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
This makes it an actual Pub package like most other code inside the SDK
repo. The main goal is to make it easier to write tests for the test
runner itself.
This change:
- Moves all of the code from tools/testing/dart/ over to
pkg/test_runner. Most of it ends up under test_runner/lib/src.
- Move tools/testing/dart/main.dart to
pkg/test_runner/bin/test_runner.dart.
- Move standalone_2/io/test_runner_test.dart to
pkg/test_runner/test/test_runner_test.dart. I don't think it currently
works, but it wasn't being run in its old location either.
- Add test_runner to the analysis-server bot. This ensures the
test_runner package is static error clean.
- Remove standalone_2/io/test_runner_analyze_test.dart which used to
attempt to do the above and is no longer needed.
- Update test.py to look for the test runner at its new location.
- Add test_runner to the repo .packages file and remove the weird
test_dart pseudo-package. (I think this fixes #35279.)
- Remove status file entries for the removed standalone_2 tests.
There are no code changes to the test runner itself aside from fixing
up import paths.
Change-Id: I3d05d50d222b291848fa5a30de2846e803bc81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105821
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Rename the library prefix used in imports from `JS` to `js_ast`. Create more of
a distinction between:
* `JS` the library. Now named `js_ast`.
* `js` the const instance of a JSBuilder.
* `JS` the helper to inline javascript in the SDK patches
and runtime libraries.
Ignore the lint in the js_ast directory to avoid additional diffs for the
eventual un-forking of the package.
Cleanup a few unused imports.
Issue #37218
Change-Id: I039c1048876d9d9ad424fbec3ad555d300845a3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106160
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
These will be tracked through SSA to generate correct recipe strings.
Change-Id: Ifebeead0f39d87be3208c673e34793145c64cf23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106181
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
There is at least one case (but not many) when this happens internally.
R=brianwilkerson@google.com
Change-Id: Ic940cb836f58467d40ed7b31cb8bb43cf12eee50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106165
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>