Change the terms `template`/`tip` in the analyzer and front end's
`messages.yaml` files to `problemMessage`/`correctionMessage`.
Rationale: these terms were previously agreed on for unifying the
analyzer and front end, and they are currently used in the
`Diagnostic` class, which is part of the analyzer public API.
Change-Id: Ifaed92ab5176bba7b7f4c3bb915e9839520330f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215149
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Aims to automate the process of bumping a single dependency.
To bump pub_semver to the newest commit invoke as:
```
> dart tool/manage_deps.dart bump pub_semver
```
Change-Id: I16a3edabfb03adbd4460fb3cd81738a792e44d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213764
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
I've included both the YAML file (`messages.yaml`) and the script I
used to create it (`extract_errors_to_yaml.dart`), so that we can keep
the YAML file up to date until we finish writing logic that code
generates the analyzer errors from the YAML file.
Change-Id: Icbdcaf63a37105b666b11f7356e3fa246a8d65cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214133
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This fix is pretty simple; we have the inferred type available on [node], so we just need to create a new DartObject which uses that type.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Ib53ff381b8c9c864f97eb2a4869d3798e028c30f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Changes:
```
> git log --format="%C(auto) %h %s" a817863..37d0592
37d05928 Don't ignore 'packages/' over the root-dir (#3162)
85e11718 Add in-memory cache to store version listings (#3163)
46f79d5b Use source.hasMultipleVersions to decide when to show version constraint. (#3159)
0e553a07 Warn against likely bad env-var name (#3146)
30580bee Migrate src/git to null-safety (#3158)
```
Change-Id: Ic04937ad0adbeb228770087dedb25ccfcc4f3206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215202
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
In Dart 2.15, we're removing "dartfmt" in favor of "dart format".
Change-Id: Id26b32872e72e97a45cfd1e28defea9adc38aa24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215183
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: Id21c2f2ceb58f5007c55eeea6a1d57bb09f2f0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215184
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
This exits current isolate immediately. If [port] is provided, then [message] is verified and sent out as isolate exits.
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47164
Change-Id: I513f4d7ceb5d74820f4aee60f5799b7b5193f2e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214312
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This currently fails for the CFE with:
static error failures:
- Unexpected error at line 137, column 14: A value of type 'int?' can't be assigned to a variable of type 'int' because 'int?' is nullable and 'int' isn't.
- Unexpected error at line 137, column 25: Operand of null-aware operation '!' has type 'int' which excludes null.
Bug: https://github.com/dart-lang/sdk/issues/47338
Change-Id: Ia55e19a0bf296a8427f6510d6ddda5016acdecea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215101
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Allows further optimization to pass along return type
information and remove extra AsExpression casts.
Change-Id: I87aef171887e3f9af4c80003ff284eb2503d0cdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214460
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
This prevents objects, such as InstructionSection, that have no ordinary references from being labeled as "Uncollected Garbage".
TEST=examine heap snapshot in an AOT build with bare-instructions enabled
Bug: b/200288075
Change-Id: If576d7f9eabb80afaca1b600507c3a9629beeafd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215006
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
When specializing x == y comparisons where one of the operands is known
to be a Smi but the other one is *not* only emit StrictCompare
if either x or y are nullable. For non-nullable equality comparisons
prefer EqualityCompare which allows to avoid redundant boxing as
non-nullable integer values are highly likely to be unboxed.
TEST=vm/dart{,_2}/aot_prefer_equality_comparison_il_test
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try
Change-Id: I1153f111dcbb518d25d753dc4357c72522389951
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214962
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Our current unit testing infrastructure does not make it possible to
test AOT compilation pipeline end-to-end, because it does not run TFA
when generating Kernel.
This makes it challenging to write regression tests for certain issues.
Instead we extend test runner with a capability to perform IL matching
when running AOT tests.
runtime/docs/infa/il_tests.md provides details on how to write such tests.
TEST=manually
Change-Id: I6f5220b814f4a5d8c053efacd3711df495dea404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214961
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
* Tests constructor tear off values and calling torn off constructors.
* Covers default, named, redirecting, and factory constructors at break
point locations in a method, global function, and inside the default
constructor.
* Create new test suites for legacy code (Dart language version 2.11)
in amd and ddc module systems.
* Sound and Unsound suites now run code without a Dart language comment.
Change-Id: I9cf16c258ce6ece7c436f9deb044ed821f980d1b
Fixes: https://github.com/dart-lang/sdk/issues/47214
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214866
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Previously, these mappings were computed on the fly during generation
of syntactic_errors.g.dart. Moving the mappings to their own data
structure makes the logic easier to re-use.
Change-Id: I1c38649b8c4aa4a42a6aa560faf67502d1c6560f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
I will try to optimize it further later, but for now O(n) even
thought with somewhat high coefficient should be good enough.
Change-Id: Ia73a34c86e1da90ea4188340aa43983d79732392
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Given an expression like `e<T>`, where the static type of `e` is a callable type, treat the expression as if it were a type instantiated tearoff of the `call` method, as in `e.call<T>`.
Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: I62fb23677b0df04468dd48532e82ec5ad46fc685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214869
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Remove the static shared resource as it caused race conditions with
multiple instances of ClassWithNativeField.
Instead introduces allocatable resources which we have more control
over, but can otherwise be used in a similar fashion.
TEST=Updated existing test.
Bug: https://github.com/dart-lang/sdk/issues/47224
Fixes: https://github.com/dart-lang/sdk/issues/47224
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Change-Id: I98dbf6ba85982392af7ce754d5b8d8fdb97f4d7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214600
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
* Move compare_results.dart to pkg/test_runner.
* Clean up analyzer issues in compare_results.dart.
* Add a test for compare_results.dart.
* Fix compare and extend results to detect expectation changes.
Change-Id: I451ddc2d0b01a7e5fd7c9d791b000c786c2f2c93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214805
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Using interpolation ensures that a `null` returned from `o.toString()`
in a non-sound application is treated consistently.
The error message has been upgraded to include the receiver to make
it easier to find the method. Since this error values are reported using
`Error.safeToString`, this will be reported using the class name:
```
ArgumentError (object): toString method returned 'null': Instance of 'BadToString'
```
VM, DDC and dart2js runtimes are updated to make the handling consistent
on VM and web.
TEST=added
Change-Id: I48d8f721dfb3a431dbeacdaa39a9f3a8273e902c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214741
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
We were unnecessarily failing allocations that use the last bit of space.
TEST=ci
Change-Id: I77981b8bcacc5f1edab4de11dcdf1afcb123ab13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214865
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
1. We start stopping the plugin in removedContextRoot.
2. We add the plugin to the map in addPluginToContextRoot.
3. We receive the notification that the plugin stopped, and remove the
plugin by its path from the map.
The issue is that the map has already been updated to contain the newly
started plugin, with the same path. As a result, we forget that we have
a plugin started, and never stop it.
Bug: https://github.com/flutter/flutter/issues/90868
Change-Id: I46c294c555905f0e9f298044718b281cb890e8ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214862
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
When running tests using `test.py`, multiple tests are run in parallel
by different processes, which means multiple processes may be trying
to format text at the same time. To avoid them clobbering each
others' data, we need to ensure that formatText uses a different
temporary file path each time it runs. The easiest way to do this is
with the `Directory.createTempSync` method.
I have an upcoming CL that increases the amount of code generation
done by the analyzer; this fix is necessary to ensure that it passes
trybots reliably.
Change-Id: I92e2f2fcaec9032da90e8c271371d3e4cea59ab3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>