Commit Graph

113090 Commits

Author SHA1 Message Date
Slava Egorov 1707f11db4 [perf_witness] Ignore socket deletion errors on shutdown
Users report sporadic failure on Windows ARM64 but I am unable to 
reproduce this locally.

Fixes https://github.com/dart-lang/sdk/issues/63343

TEST=Unable to reproduce the underlying issue

Change-Id: I78c0be78f5e70755b69fec50a896aaef6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/502060
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-05-08 05:43:48 -07:00
Jens Johansen b511694fab [CFE] Don't call enableNative when creating BodyBuilderImpl - we never use the field anyway
When compiling a big internal app this reduces the wall-clock time from
`2m21.756s` to `1m43.671s`.

Change-Id: I0e89c0c41fe59d2fb3541a50c8c7e2963b0bff47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501461
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-08 03:06:34 -07:00
Sergey G. Grekhov 07d8325735 [co19] Roll co19 to 266d9f242d9ddcbb4be96995cd16839b8e577cf3
2026-05-07 sgrekhov22@gmail.com Fixes dart-lang/co19#3771. Replace multitests by static errors tests (dart-lang/co19#3778)
2026-05-07 sgrekhov22@gmail.com dart-lang/co19#3203. Test primary constructor parameter in initializing expression (dart-lang/co19#3787)
2026-05-07 sgrekhov22@gmail.com dart-lang/co19#2119. Update assertions in const literals tests (dart-lang/co19#3773)
2026-05-06 sgrekhov22@gmail.com Fixes dart-lang/co19#3698. Rename tests, delete obsolete ones (dart-lang/co19#3786)
2026-05-06 sgrekhov22@gmail.com dart-lang/co19#3315. Add more tests for parameters of a constant primary constructor (dart-lang/co19#3784)
2026-05-05 sgrekhov22@gmail.com dart-lang/co19#3698. Add/update tests for execution (dart-lang/co19#3765)
2026-05-05 sgrekhov22@gmail.com Fixes dart-lang/co19#3783. Update expected errors in static_processing_A32_t05.dart (dart-lang/co19#3785)
2026-05-05 sgrekhov22@gmail.com dart-lang/co19#3779. Add tests for `FileSystemEntity.type()` (dart-lang/co19#3782)
2026-05-05 sgrekhov22@gmail.com dart-lang/co19#3779. Fix contentChanged_A01_t01.dart if no event was fired (dart-lang/co19#3781)
2026-05-05 sgrekhov22@gmail.com dart-lang/co19#3779. Fix isDirectory and isFile tests. Add tests for `typeSync` (dart-lang/co19#3780)

R=athom@google.com, eernst@google.com

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,dart2js-minified-linux-d8-try
Change-Id: If859ebc5d4e0082963438f49e4ac68feded96db4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501900
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Sergey Grekhov <sgrekhov22@gmail.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2026-05-08 01:48:59 -07:00
Martin Kustermann 28f200b97d [dart2wasm] Calculate element stride for class id table and target table separately
It reduces e main module by around -0.3% compressed/uncompressed.

The dynamic calls use 2 tables. One of them stores class ids and one
stores targets. We can compute the table initialization for these two
tables independently.

The targets table may contain different targets but the class ids may
still be consecutive and therefore allow a larger stride which may move
initialization from element section to a loop in the #start function.

Change-Id: Ief5415f035ce1b854aecaa635a5e916938217b8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501420
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2026-05-08 00:46:52 -07:00
Martin Kustermann 9fd82be4ff [dart2wasm] Disable type branding by default
This reduces e main module by around 1.5% compressed and 0.7%
uncompressed.

Except for a few special wasm struct types, we don't rely on type
uniqueness as we never use e.g. `ref.test` on normal wasm structs of
dart classes, closures, closure contexts, ...

So for otherwise structurally equivalent types, we can allow merging the
types. This can lead to confusion when reading wasm files because two
unrelated Dart classes may end up being represented with the same wasm
struct. To avoid this confusion when reading .wat files, we make it
clear in the type name and field names that it can be any of the
original dart classes / fields.

One can enforce unique types by passing `--no-unique-types`.

In IR tests we default to `--unique-types` to make the IR tests more
readable, except for 2 newly added tests that test this flag.

In essence this is the follow-up work on [0] which started sharing wasm
structs between classes in a hierarchy.

We enable `--unique-types` in opt>=2 (just like in --minify)

The dart2wasm compiler may now emit two identical recursion groups. We
could avoid that, but that would be a bigger refactoring of the type
building code in `package:wasm_builder` and `wasm-opt` will remove the
duplicate recursion groups anyway.

[0] https://dart-review.googlesource.com/c/sdk/+/472181

Change-Id: I36a5b7cfc3abb5318658fa67dae36e1c0a1e4d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501140
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-08 00:32:15 -07:00
Kevin Moore a77583dd11 [profiling] update generated proto files
Eliminates analysis errors

Change-Id: I8a7508687502b021ead265316825a1d16fb18a65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501706
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-07 23:51:32 -07:00
Konstantin Shcheglov 1aa7d7321f CQ. Use in-code diagnostic expectations.
Add support for keeping parser diagnostic expectations in the source
snippets they describe. Expectations are written as caret markers and
diagnostic comments, and regenerated from the parser's actual
diagnostics before comparison.

This keeps parser recovery expectations close to the code under test and
removes the need to maintain offset-based `assertErrors` lists by hand.
The updater also removes existing expectation markers before writing the
canonical form, so marked snippets can be refreshed in place.

Migrate recovery parser and class parser tests to the new
`assertExpectedDiagnostics` helper, including no-error cases where an
unmarked snippet is the expected canonical form.

Update `test_runner` to exclude `/pkg/analyzer/` from searching static
error expectations.

Bug: https://github.com/dart-lang/sdk/issues/63335
Change-Id: Ic9866da8cc601c6b360552ba576e8aa1646f89a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2026-05-07 15:30:45 -07:00
Brian Wilkerson bec664e1e8 Add a lint to convert normal parameters to declaring parameters
This is another lint intended primarily for testing. It is intended to
flag every non-declaring formal parameter in a primary constructor that
could be converted to be a declaring parameter.

There is an existing assist to convert a non-declaring parameter to a
declaring parameter, but I want to make sure that this lint is catching
all of the right conditions before enhancing it to be a fix.

Change-Id: I10f8a4980bbc77d35a920a221ef26957f96d22d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501580
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-07 13:58:35 -07:00
Konstantin Shcheglov 1309dffc0a CQ. Move analyzer diagnostics back into analyzer.
Move the analyzer-only Diagnostic, DiagnosticMessage, Severity, and
locatable diagnostic helper types out of _fe_analyzer_shared and into
package:analyzer.

I paln to make changes outlined in
https://github.com/dart-lang/sdk/issues/63311 and chat discussion.
Keeping these classes in the analyzer simplifies the migration and
avoids introducing a shared abstraction before there is a concrete need
for one.

If we decide later need to have a shared abstraction, we can always
extract one at that point. With coding agents internal code motion is
cheap.

Update analyzer, analysis server plugin, analyzer plugin, linter, and
scanner call sites to import the moved APIs from analyzer libraries, and
refresh API baselines to reflect the new public owner.

Change-Id: Ie0ef0f01c6e4be7ebaac25619ac3e3fe991a44d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501000
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-07 13:54:59 -07:00
Parker Lougheed 9b2fc36886 [linter] Update changelog for 3.12 and 3.13 lint changes
Also regenerates the rules.json file with the latest lint details.

Change-Id: Ibee9adb8b246f606f1765aa52c34fcf4b308b9c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-07 13:50:32 -07:00
Brian Wilkerson 4d93f4d586 Lint all cases in which a primary contructor could be used
The purpose of this lint is to help automate testing of the primary
constructors feature. It is unlikely to be shipped in its current form.

The goal is to flag all cases where a secondary constructor could be
converted to a primary constructor. This includes classes with a default
constructor.

There is an assist that should convert most of these cases, but it has
not yet been enhanced to work as a fix. That will be done in a future
CL. I want to implement the lint first so that I know all of the
conditions that the fix needs to handle.

The most important part of this review is to ensure that the tests are
reasonably complete. If there are any missing cases where the lint
should flag a constructor for conversion, or any missing cases where a
conversion should not be requested, please let me know.

Change-Id: Ib8256677a0659479ab341974b87bd03c953ff644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500583
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-07 13:46:54 -07:00
Kevin Moore 8a965f86c1 [dartfuzz] Fix analysis issues
Mostly adding types

Change-Id: I2f161654a8fee33380075a64ebe7968ac1e741e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501704
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2026-05-07 13:16:29 -07:00
Kevin Moore c20b137715 [benchmark] fix analysis hints in benchmark directory
Reduces noise in VS Code when opening the whole repo

Change-Id: Id1de9afe4fe2f1d003317b9790b04ac6f0b06861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501703
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2026-05-07 13:09:16 -07:00
Kevin Moore 5eb33c3a22 [code-workspace] ignore dart2js swarm demo
This code is VERY old and makes the modern analyzer very sad

Change-Id: I178bf208ab73b3e66bec1ff630e3556adfc13fd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501761
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
2026-05-07 13:08:25 -07:00
Brian Wilkerson 687a5cb840 Stop reporting unnecessary_const_in_enum_constructor for constructors outside an enum
Closes https://github.com/dart-lang/sdk/issues/63338

Change-Id: I7b613e22df0eb563076d85ac7f46a7c22a4cb2d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501561
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-05-07 12:53:18 -07:00
Konstantin Shcheglov c47b30ee9a Augment. Report augmentationTypeParameterName.
Move augmentation type parameter validation from element binding to the
error verifier so that augmentation diagnostics are reported from the
same phase as other declaration consistency checks.

After verifying that the augmentation has the same number of type
parameters as the introductory declaration, compare each written type
parameter name against the corresponding introductory fragment and
report augmentationTypeParameterName when they differ.

Apply the check to augmentations of classes, enums, extensions,
extension types, mixins, top-level functions, and methods.

Change-Id: I09b2b518cb8d89f6308dcb638dc502fb273cef59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501702
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-07 12:44:34 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com 40628d0b43 Roll Fuchsia SDK from 31.20260501.4.1 to 32.20260507.4.1
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-sdk-dart-sdk
Please CC fuchsia-3p-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia SDK: https://bugs.fuchsia.dev/p/fuchsia/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: I4cbd49b22206f37af2253242f994bfa45b48ea98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501720
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-07 12:44:01 -07:00
Keerti Parthasarathy 18c1a3f7fb [data-driven]Add a transform to replace a library import.
Closes https://github.com/dart-lang/sdk/issues/62849

Change-Id: Iffdf3aeb2c764a1c0227e82ca2517b5a56be206a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501660
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-07 12:23:47 -07:00
Danny Tuppeny 2f7951190b [analysis_server] Prevent session log being overwritten on every message
This changes the SessionLogFileSink from using `writeAsStringSync` and overwriting the whole file on each message. It does this by using `openWrite()` and keeping the `IOSink` instead.

This means:

- it uses `dart:io` (we don't have `openWrite`/sink support in the abstraction)
- we need to call `close()` to flush the file during shutdown (there was already a shutdown method on the session logger, but it wasn't used or called, so now it is)

This does mean the tests for this class write to the physical disk, but there are only two of them - most other tests use the in-memory sink (or are just testing the normalizer).

Fixes https://github.com/dart-lang/sdk/issues/63275

Change-Id: I7ef347fc46d8ce3daf30ed2f9965e8921c5c4856
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-05-07 11:53:58 -07:00
Danny Tuppeny 24bc4f1ed2 [analysis_server] Update recorded scenarios to match new normalized log format
The previous CL changes from just replacing paths, to handling URIs + filePaths separately.

This updates the committed scenario files so:

`file://{{workspaceFolder-0}}` becomes just `{{workspaceFolder-0}}` (since this token implies the file URI), and `{{workspaceFolder-0}}` (without the prefix) becomes `{{workspaceFolder-0:filePath}}` (to signify it was a file path).

Even with these changes, they fail for different reasons (invalid git hashes, mismatches in expected vs actual requests) so I there is still more work to do here.

Change-Id: Ic1543ab96ca002073540ef034adecb4c9ea57e58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-05-07 11:49:53 -07:00
Konstantin Shcheglov 652c896bee Augment. Add more precisely typed ExecutableFragmentImpl.precedingFragments, return List(s).
Make fragment chain traversal return concrete lists instead of lazy
iterables. This gives callers a stable, reusable collection when walking
preceding or following augmentation fragments.

Add more precise overrides for executable and formal parameter fragments
so callers can work with `List<ExecutableFragmentImpl>` and
`List<FormalParameterFragmentImpl>` directly. Use the typed list results
in augmentation linking code and remove now-unnecessary casts and
intermediate `toList()` calls.

Change-Id: I8cdc7f80c70bff7001d16f97d3223255a3594849
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501700
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-07 11:06:28 -07:00
Danny Tuppeny 11b1da577f [analysis_server] Handle URIs/filePaths separately in log normalization/replay
For posix paths, replacing the file path during normalization and then swapping it back later works for both paths and URIs, because a file URI just contains the file path verbatim:

file:///foo/bar/baz

However that's not the case for Windows:

C:\foo\bar\baz
file:///c:/foo/bar/baz

So when normalizing, we need to know if we normalized a URI or a file path, so that we can reverse it later.

With this change, we'll use `{{workspaceFolder-0}}` for the URI, and `{{workspaceFolder-0:filePath}}` for the file path. Then when reversing, we can easily put the correct one back.

This also updates the log replace/scenarios to use the LogNormalizer to perform the denormalization so they don't have to have duplicated logic about what to restore.

I've also updated the existing committed scenarios (EDIT: moved this to a separate CL because Gerrit is falling over) - although even with those changes, they all fail for different reasons (invalid git hashes, mismatches in expected vs actual requests) so I think there is still more work to do here.

Fixes https://github.com/dart-lang/sdk/issues/63330

Change-Id: Ib4c4aabe2c7c0d089bd620bdf00de37acde25f52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501600
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-07 10:03:24 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com 8e43e2f4ef Roll Fuchsia SDK from 31.20260430.4.1 to 31.20260501.4.1
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-sdk-dart-sdk
Please CC fuchsia-3p-engprod@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Fuchsia SDK: https://bugs.fuchsia.dev/p/fuchsia/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try;luci.dart.try:vm-fuchsia-release-arm64-try
Change-Id: I03147f6d451a75982d1d25999560c6ae016d585d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499981
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2026-05-07 10:02:25 -07:00
Nate Biggs 0af31e37bb [dart2wasm] Fix context collection emptiness false positive.
In some cases, closure contexts were being left out of the parent chain
of their children because they were empty at the time the child closure
was created. If a usage appeared later in the visit of the parent, the
context would no longer be empty but the child would already be created
without a parent.

This was easiest to recreate in sync* function because unlike async, it
doesn't introduce hoisted helper variables (these immediately mark the
parent as non-empty).

In the attached bug the repro only happens with named parameters because
TFA transforms the named parameter into a Let that introduces a variable
before the closure with the usage in the let body after the closure. The
new test explicitly introduces the same pattern of a variable declared
before the closure and used after it.

The fix here is to not eagerly check for emptiness of the parents.
Instead we post-process the Contexts and relink the parent tree skipping
any empty nodes.

Bug: https://github.com/dart-lang/sdk/issues/63264
Change-Id: I2f75506b9fa879544b1a606d8f157fbd44ba8ce2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500680
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-05-07 09:21:19 -07:00
Konstantin Shcheglov 6c377d447b Augment. Rename element model tests for top-level functions and variables.
1. Merge augmentation tests into all tests.
2. Rename test methods.
3. Sort.

Change-Id: Id7f95a6ddaedfd9f05d8c344634945c28c437992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501222
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-05-07 09:05:38 -07:00
dart-autoroll@skia-public.iam.gserviceaccount.com b2cbe1778c Roll gn from 1740f5c25bca to 88604adbcec2
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/gn-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@rotations.google.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in gn: https://bugs.chromium.org/p/gn/issues/list
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-linux-arm64-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I1037283919871e9307f812c2f56800d1b4ab433c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501440
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2026-05-07 08:18:28 -07:00
FMorschel d29da25302 [DAS] Fixes occurrences for declaring parameters
Fixes: https://github.com/dart-lang/sdk/issues/63124
Change-Id: Ie94f23da1c47d393124491c37a6098ac66c581b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497103
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: FMorschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-07 08:03:26 -07:00
Erik Ernst 1b75e2701c Support promotion of instance variables with anonymous methods
This CL adds support for promotion of certain private final instance
variables along with anonymous methods. The promotions do not differ
from the ones which are already available in Dart without anonymous
methods, but it requires some generalizations to handle the changing
value of `this` which is made possible by anonymous methods.

Change-Id: I720a5fa6d29a8a7d19bb2e167dc135f97492b525
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498840
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-07 05:39:13 -07:00
Slava Egorov d2903a568c [vm/io] Range check Filter_Process arguments
Add a check both in the native implementation and on the Dart side (to
avoid throwing uncatchable ApiError).

Simplify native implementation: Dart_ListGetAsBytes has fast path for
byte sized typed data lists, so there is no reason to inline the 
same fast path into the caller.

Reported by Kyounghwan Kim (@drg2533)

TEST=runtime/tests/vm/dart/regress_b508627933_test.dart

Bug: b/508627933
Change-Id: I14c0f5270f143ed2386200241b13313f6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500461
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-05-07 04:18:06 -07:00
Martin Kustermann 0f9ce46c6d [dart2wasm] Ensure the field in BoxedBool is non mutable
Change-Id: Idfa251e647f9d0205086d17334103a511366df7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501460
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-07 04:05:45 -07:00
Johnni Winther a6ec5cee79 [cfe][InternalNodes] Add InternalVariableGet/Set
This adds internal AST nodes for VariableGet/Set. This is a step towards separating VariableDeclarationImpl from VariableDeclaration.

Change-Id: If85d8917225fdbd1b2411ef5c2493e8e6258e6be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500800
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-05-07 03:46:06 -07:00
Martin Kustermann a3deacfd58 [dart2wasm] Remove unused annotations and field
Change-Id: I83a9bd6a8aedb5312381b975c49e287ee76bc11b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501141
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-05-07 03:46:02 -07:00
Erik Ernst 4d964c4804 Add test_runner support for // [spec_parser] comments
This CL adds support to the test runner for the test outcome
expectation syntax that uses `// [...]` to indicate which diagnostic
we should expect with the given tool. Currently, `...` is `analyzer`
when testing the analyzer and `cfe` when testing the common front end.
After landing this CL, it also supports `// [spec_parser]`.

This change would allow us to migrate several tests from the multi-test
format (like `code; //# 01: compile-time error`) to the new format, in
particular tests with intentional syntax errors.

Change-Id: I5dd2560a873eb7433d3e07aa8f393e83c51b28e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501161
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2026-05-07 03:00:53 -07:00
Johnni Winther f78d831de7 [cfe][InternalNodes] Make internal int literals extend InternalExpression
This removes the need for ExpressionJudgment and makes the internal int literals strictly internal to the CFE.

Change-Id: Idee2df56fb07be15da797164de7603be02df70c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497241
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2026-05-07 00:15:24 -07:00
Johnni Winther 6a6f59f715 [cfe][InternalNodes] Move for-in lowering to inference visitor
This adds internal nodes for the encoding of various versions of for-in loops and moves the lowering to be performed as part of the inference. This avoids the need to create lowered and external AST nodes directly during body building.

Change-Id: If559bc19ff9e6aacb457413c71956c18eae2a4b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499542
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-07 00:15:24 -07:00
Jens Johansen 3ecf2aa096 [CFE/DDC] Move renaming of late lowerings to dart scope calculator
Small step towards https://github.com/dart-lang/sdk/issues/62645

Change-Id: Ia4e8b0f5943049a6592722ca228498f501feff9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500420
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-05-06 23:45:17 -07:00
Sam Rawlins c0cbb31d01 DAS: Add tests on add_type_annotation for dynamic
Closes https://github.com/dart-lang/sdk/issues/56730

This bug is fixed already; this change introduces unit tests.

Change-Id: I85fdbe2cb1ab46667e6c265576abb774a5dafda6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-06 16:18:01 -07:00
Nicholas Shahan 23bd610f97 [dwds] Copy changes from github
Copy into pkg/dwds and pkg/dwds_test_common.

* https://github.com/dart-lang/webdev/commit/ac63d06eb9a186f5799b5e6ecb97eb097562ed8a
* https://github.com/dart-lang/webdev/commit/f9a56607fac5ad0c979d2647cf11d3e3be993bf6
* https://github.com/dart-lang/webdev/commit/b2cd91f6ef8072847cba0cde33fe6e007403fb7b

Selectively revert incompatible changes to the pubspec.yaml files.

Change-Id: I4fc2bbd7440e699bb010262529edfc19a0fd3433
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501221
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-05-06 16:14:04 -07:00
Alexander Aprelev 5a98fe5564 [vm/isolates] Avoid leaving isolate as part of native message handling.
Letting isolate go seems to be problematic. If this native messaging api is used during runtime call, then original isolate might end up on a different worker os thread causing remembered frame pointer(remembered as part of entering runtime call) to become invalid due to different stack bounds of this new thread. Invalid frame pointer causes immediate assertion failures during stack walk done for GC purposes or for exception handling.

TEST=ci, https://dart-review.git.corp.google.com/c/sdk/+/486522/comments/ee54d99f_a5c2a9d4

Change-Id: If69076bb9e107502dfef819de73829d9682bb134
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2026-05-06 14:42:04 -07:00
Konstantin Shcheglov 0a5604c223 Support for cross-file context messages in test_runner/.
Bug: https://github.com/dart-lang/sdk/issues/63318
Change-Id: Ie02aef92d9ab0e04ce864a85ed6071d5e4b5e14f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500820
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-06 13:23:57 -07:00
Konstantin Shcheglov 90073036fb AD. Run discardMemoryExpensiveData() when a driver switches to idle.
Discard memory-expensive driver data only when a driver first reaches
the idle work priority, instead of doing it on every scheduler loop
while it remains idle.

Track drivers whose idle discard has already run, and clear that state
when a driver gets more work or is removed. This preserves the
fine-dependency idle cleanup while avoiding repeated calls during long
idle periods.

Change-Id: If480e473fe2a1e8b6c4725cdd4ac4359afdba4a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500500
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-06 13:18:57 -07:00
Ryan Macnak 5bb366bb9f [gardening] Remove lib/async/future_test from isolate stress test.
Bug: https://github.com/dart-lang/sdk/issues/63333
Cq-Include-Trybots: luci.dart.try:iso-stress-linux-arm64-try,iso-stress-linux-x64-try
Change-Id: I9521563be52a902db0720b98c345d7502324d8b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501200
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-05-06 13:13:46 -07:00
Danny Tuppeny eb362d4261 [analysis_server] Support diagnostic server request for LSP-over-Legacy
Change-Id: I4793a70681360a8eeaf717457bd6b8b6f5eea8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501180
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-05-06 12:47:27 -07:00
Paul Berry 7caaf2846d [docs] Improve link for filing breaking change requests.
Previously, the link text `Dart SDK issue tracker` in the breaking
change documentation pointed to the main page of the SDK issue
tracker. The user had to click `New issue` and select the template
`Propose a breaking change (for contributor use only).`.

With this change, the link goes straight to the template
(https://github.com/dart-lang/sdk/issues/new?template=6_breaking_change.yml),
which should streamline things a bit.

Change-Id: Idff83c28a27ca6e15a30d10b846b1a6f6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501240
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-05-06 12:38:38 -07:00
Konstantin Shcheglov 9f1438813f Fix JsonErrorFormatter to use right LineInfo for context messages.
Change-Id: Icd9e254308a54e47ea3be63220ada5fd028712e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500660
Reviewed-by: Paul Berry <paulberry@google.com>
2026-05-06 11:28:54 -07:00
Danny Tuppeny eed5d692ab [analysis_server] Only replace full paths or start of paths followed by separators during normalization
It's possible that there are nested paths in LSP workspace folders, such as:

/foo
/fooBar
/bar/foo

We shouldn't just replace each path we were given, as it might replace the wrong parts of other parts. Instead, require the path to be surrounded by quotes, or prefixed by a quote and followed by the appropriate path separator.


I also tweaked the benchmark test a little to report the time for the first call separately from the others, since that one triggers the regex build.

On my machine, timings currently are:

```
Replacing 250 paths in payload of 2097152 bytes
Iteration #1, First: 43ms, Rest: 30ms
Iteration #2, First: 38ms, Rest: 30ms
Iteration #3, First: 33ms, Rest: 30ms
Iteration #4, First: 37ms, Rest: 30ms
Iteration #5, First: 31ms, Rest: 29ms
```

Change-Id: I75de1fb36a16636e0f50099cced1d5386318d589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-05-06 10:40:57 -07:00
Alexander Markov 27a5d75c2f [modular_aot] Code generation for UnaryBoolOp
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ia3913b94b6aa357b352d10572342fab3b55b4825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500482
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-06 09:48:04 -07:00
Alexander Markov 6251367ab1 [modular_aot] Compile closure functions and support captured variables
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: Ibbb4b4ed73c89f458e2b08898a96f4f1979965eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492663
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2026-05-06 09:47:58 -07:00
Konstantin Shcheglov a5ab51b142 CQ. Remove reportScannerErrors flag from Scanner.
Remove the `reportScannerErrors` option from `Scanner.tokenize`. The
parser handles scanner error tokens directly, so the scanner no longer
needs a mode that translates and reports them before parsing.

Update all callers to use the simplified `tokenize()` API. Adjust parser
recovery expectations where diagnostics are now reported at the
synthetic token location chosen by parser.

Change-Id: Ia2d479ba57b3156f1a4bab47c32444892c9d0aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500361
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-05-06 09:13:11 -07:00
Danny Tuppeny 8b29e93bea [analysis_server] Include count of additional errors in "Rename anyway?" prompt
Follow up from https://dart-review.googlesource.com/c/sdk/+/499600

+ fix typo
+ fix bug that inline_method treated required named arguments as optional instead of required

Change-Id: I1c088138d990a27ed74ff51993bbe4032b245693
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-05-06 07:30:09 -07:00