Commit Graph

112696 Commits

Author SHA1 Message Date
Ryan Macnak df5cae97dc Revert "[vm, ffi] Remove special case for Fuchsia FFI callback thunks."
This reverts commit 61f45d66b2.
This reverts commit a0ab33ac52.
This reverts commit 68e2512ace.
This reverts commit fb732a570d.

TEST=ci
Bug: b/501539846
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try,vm-ffi-mac-debug-simarm64_arm64-try,vm-ffi-mac-release-simarm64_arm64-try
Change-Id: I7f27bb15bf1fcb26fe8793a043b7530ed99a02a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495480
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-14 12:22:48 -07:00
Brian Wilkerson 19f129e946 Update diagnostic docs so that more can be validated
This uses the previously added `%ignore=` syntax to enable validation of
the diagnostic documentation for several diagnostics that were
previously not being validated.

In the process I also cleaned up a few of the code snippets used in
those docs in order to minimize the number of ignored diagnostics.

I removed the newly validated diagnostics from the list in the validator,
and improved the comments for the ones that are still being ignored to
show why they're ignored and point to some possible future remediations
that would allow them to also be validated.

Change-Id: I46b0eeaab86740ba82784987e84f3e93046d39f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494941
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-14 12:08:08 -07:00
Danny Tuppeny 17f17178e2 [vm_service] Allow setting a pingInterval on VM Service connections and default to 15s
This acts as a keep-alive to prevent dropped connections by proxies (such as Norton antivirus).

Fixes https://github.com/Dart-Code/Dart-Code/issues/6026

Change-Id: I44ee326a426aa73e154f1bf1fa9ef520e3672e58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495401
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-04-14 11:58:25 -07:00
Danny Tuppeny 4f99b5b870 [analyzer_plugin] Default parameter name for setters to value
Change-Id: Id20717cba30f85486bd3ed41278efea222fd8b4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495400
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-14 10:58:43 -07:00
Sam Rawlins 577a7abf67 analyzer: Validate plugin diagnostic configuration
This adds validation that plugin diagnostics are configured with one
of the valid values (taken from one of the test cases):

```
plugins:
  one:
    diagnostics:
      code1: ignore
      code2: warning
      code3: error
      code4: info
```

Change-Id: I2a77988c2efe1d9e0fdcd33558ed970fbe4c47c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494781
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-14 10:58:25 -07:00
Paul Berry 3dd4265486 [front end] Drop unnecessary isVoidAllowed: true.
In `_SyncContext._checkValidReturn`, the call to `ensureAssignable` is
guarded by a check that `expressionType is! VoidType`. Therefore it's
not necessary to pass `isVoidAllowed: true` to
`ensureAssignable`. Removing this argument reduces the number of uses
of `isVoidAllowed` in the front end, which makes it easier to reason
about front end void checks.

Change-Id: I8bb30ca02941843dfb489045fcac536e6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493484
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-04-14 10:34:30 -07:00
Brian Wilkerson fd8527f4dc Update convertToInitializingFormal to handle promary constructors
Closes https://github.com/dart-lang/sdk/issues/63045

Change-Id: I642115ef872b72756dd584f3c820f3ae6a5cbe4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495080
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-14 10:28:21 -07:00
Keerti Parthasarathy 1d7cd927b5 [primary constructors] Add tests for remove_initializer
Closes https://github.com/dart-lang/sdk/issues/63076

Change-Id: I6d56f22d2eca99ac4ae73444098e0ad585781cb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495082
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-14 10:17:50 -07:00
Paul Berry b85e45450d [front end] Remove _DeferredArgumentInfo.argumentExpression.
This method was dead code; it had no callers.

Change-Id: Ie3f0af8e8f516d7cb0cf2b5c97612e016a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494568
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-04-14 10:05:06 -07:00
Konstantin Shcheglov b3c0f6e31a Elements. Provide value for ConstructorElementImpl.hasEnclosingTypeParameterReference, test expectations.
Change-Id: I0a7feedc741977f455722b94f6e02af0ccf257d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-04-14 09:45:30 -07:00
Ivan Inozemtsev 97685b7dbb Add missing smi tag shifts
TEST=ci

Bug: b/502506240
Change-Id: Icb81c2c0653ed7793194c2454aa3fc283e797323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495380
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2026-04-14 09:43:24 -07:00
Fedor Shcheglov b809db2c48 Track complete declarations in element fragments
Add an explicit `isCompleteDeclaration` modifier to element fragments
and include it in unlinked API signatures where empty and non-empty
bodies differ semantically.

Change-Id: I8bb452fbf234c82c213567c26d07d6f749ca3175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-14 09:35:37 -07:00
Robert Nystrom c43643c813 Use escapes instead single-line strings to avoid a test_runner test being mistaken as a static error test.
This is a tweak to https://dart-review.googlesource.com/c/sdk/+/491340

Other test expectations in this file have the same problem that CL fixes and avoid it using an otherwise unnecessary escaped forward slash. This fixes that test to use the same style for consistency's sake. :)

Change-Id: Ie1a80fc3e76b091cb0d1567b40a53362c9266ee5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495081
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-04-14 08:25:04 -07:00
Slava Egorov 0403836cdd [perf_witness] Handle stale control socket
Presence of a control socket might indicate that another isolate has
started the perf witness server, but it can also be a stale file 
from a dead process with the same pid. In the later case we need to
handle a SocketException, which will happen when we try to 
connect to this socket and purge stale control socket.

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

TEST=test added

Change-Id: Id4310bea3d469418dc7324de64f084af6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495320
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-04-14 05:07:46 -07:00
Tess Strickland f9160e5c0b [vm,dyn_modules] Fix dynamic calls from dynamic modules in the AOT runtime.
Dynamic modules may make dynamic calls to compiled methods that had no
dynamic calls in the original whole world compilation. If this happens,
then dynamically create an interpreted dynamic invocation forwarder that
then appropiately checks and delegates to the compiled function.

TEST=co19/LibTest

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try
Change-Id: I283ca501f50118606650cf434b8debe30a43f676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494520
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2026-04-14 04:26:01 -07:00
Chloe Stefantsova c82c4632a1 [cfe] Add FunctionNode.thisVariable
In the new variable model `this` is treate as a variable. Similarly to
other variables, it is placed into a variable context, which is
treated as the point of declaration of `this` variable. Since
parameter lists of a `FunctionNode`, such as
`FunctionNode.positionalParameters` and
`FunctionNode.namedParameters`, aren't treated as declarations either,
but rather as a convenient way to access the parameters, a similar
treatment of `this` variable is introduced in this CL, where it
becomes accessible via `FunctionNode.thisVariable`, in addition to
being declared in an appropriate variable context.

Part of https://github.com/dart-lang/sdk/issues/61572

Change-Id: Ia608fd01661353eb704de225f6b123900b1671b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2026-04-14 04:18:56 -07:00
Chloe Stefantsova b43c8e8696 [cfe] Remove remaining casting getters from AST nodes
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/492101, where some part
of the casting getters was removed.

Part of https://github.com/dart-lang/sdk/issues/61572

TEST=ci

Change-Id: I7eefc226ca2edeb10e80d2d110a72acb2b7770f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493681
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-04-14 02:29:57 -07:00
DEPS Autoroller 64ee0df312 Roll BoringSSL from a452b436e8ba to 94c4c7f9e0ee (1 revision)
https://boringssl.googlesource.com/boringssl.git/+log/a452b436e8ba..94c4c7f9e0ee

2026-04-09 davidben@google.com Add ML-KEM and ML-DSA to EVP_PKEY_from_raw_public_key

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/boringssl-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 BoringSSL: https://crbug.com/boringssl/new
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

Tbr: dart-vm-gardener@rotations.google.com
Change-Id: I5d9a75555e8029b2a8ef9a99af150dd0928de178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494580
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2026-04-13 17:56:37 -07:00
DEPS Autoroller 4d08e9148f Roll Fuchsia SDK from 31.20260409.4.1 to 31.20260410.3.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: If7e1d27c465f484b656b9ed6187bc242b574322b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494600
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2026-04-13 17:54:40 -07:00
Keerti Parthasarathy 8a1ef4c7d1 [primary constructors] Add test for remove_unnecessary_final
Closes https://github.com/dart-lang/sdk/issues/63079

Change-Id: Id03d2e1d9e43e1c13173f8a52719611c6793c513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-13 16:13:20 -07:00
Ben Konyi e698eed7c7 [DTD] Fix relative path preservation in symbolic link resolution
_resolveNearestExistingPath safely resolves symbolic links by traversing up the tree until an ancestor exists, but it previously dropped the components of the path that were skipped. This causes non-existent dummy paths used in tests to incorrectly resolve to filesystem roots (like C:\ on Windows or / on POSIX), causing permission check failures.

This fix computes the relative path suffix between the original path and the closest existing ancestor using path.relative, and appends it back to the resolved path with path.join. POSIX dummy path coverage has also been added to verify identical behavior across platforms.

Fixes: https://github.com/dart-lang/sdk/issues/63147
Change-Id: Iac908998f052ad9054e8213ba059156a5982a301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495000
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jessy Yameogo <yjessy@google.com>
2026-04-13 16:12:47 -07:00
Jake Macdonald 1e477f108f Bump ai to 3d3b7fdaddead83ce262377e5c4ce5b2a843066c
Also updates manage_deps.dart to handle trailing slashes.

Changes:
```
> git log --format="%C(auto) %h %s" 07df396..3d3b7fd
 https://dart.googlesource.com/ai.git/+/3d3b7fd Enable roots tools always, collapse under one tool (440)

```

Diff: https://dart.googlesource.com/ai.git/+/f1cddc8e1905b9a5753a93ce451522e564311251..3d3b7fdaddead83ce262377e5c4ce5b2a843066c/
Change-Id: Ia09061667c3e5f8642a45d6fd491143ac80556c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495060
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2026-04-13 16:05:17 -07:00
Sam Rawlins fd5f7e783c DAS: skip session logger sink tests until windows bot is investigated
Change-Id: I3179f627e2c5fa02293f630a71a53de5fefeb176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-13 15:54:21 -07:00
Sam Rawlins e53b6bc77e linter: cancel_subscriptions_test: test more cases
Change-Id: I3f2d5396c3944344d719161df96c783f4b874225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494581
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-13 15:49:46 -07:00
Konstantin Shcheglov 5661776557 CQ. Use InternalGetterElement.forSubstitution(), etc.
Replace the generic executable substitution helper with
`forSubstitution()` methods on internal executable and member elements.

This moves the logic for creating substituted constructors, methods,
getters, and setters onto the corresponding element implementations.
Each element kind can now decide whether a substituted wrapper is
needed, reject invalid cases such as non-member accessors, and combine
nested substitutions in a single place.

Also add `MapSubstitution.andThen()` so substituted elements can compose
an existing substitution with a new one directly, instead of rebuilding
maps ad hoc. This makes repeated substitution clearer and preserves the
intended order of application.

Overall, the change makes member substitution more explicit, removes
type casts and kind switches from the shared helper path, and keeps
substitution-specific behavior closer to the element types that own it.

Change-Id: I54a3bfea48ddf87b4db5c53094090f24d66a9a23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494780
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-04-13 15:39:16 -07:00
Keerti Parthasarathy 2a3a5d7307 [primary constructors] Add tests for remove_type_annotation
Closes https://github.com/dart-lang/sdk/issues/63078

Change-Id: I4689171e5cf20adedca41e93601da4342c65eeee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-13 14:52:16 -07:00
Konstantin Shcheglov 70c0e60aff Elements. Use withTypeParameters() in BundleWriter.
Use merged type parameters in BundleWriter

Use `withTypeParameters()` when writing type-parameterized fragments
instead of rebuilding a local scope from `fragment.typeParameters`.

The serialized data still comes from the fragment list, but the
resolution context now uses `fragment.element.typeParameters`. This
makes BundleWriter use the canonical merged type parameter elements when
writing bounds, default types, and other references that can point back
to those parameters.

Using the merged elements keeps the writer aligned with how later
resolution data refers to type parameters, especially when multiple
fragments are linked into a single element.

Also rename `_writeTypeParameterElement` to
`_writeTypeParameterFragment` to match what the method actually writes:
fragment declaration data, with element-backed resolution properties.

Change-Id: Iddcd7a4b15ad0717bd137da97813f761e0fba5eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494569
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-04-13 14:46:00 -07:00
Sam Rawlins 4e67fd4ec2 linter: Report avoid_shadowing_type_parameters in more cases
Fixes https://github.com/dart-lang/sdk/issues/58515

Change-Id: I8fdb3d8d7c87969667f424dd004bd57021d5d685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494800
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-13 14:24:18 -07:00
Sam Rawlins d7f099ae19 linter: prefer_const_constructors_in_immutables: test enum comparison
Fixes https://github.com/dart-lang/sdk/issues/58360

Change-Id: I2092d3f0aa9937ec684342413f30dbae6525c817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494801
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-13 14:22:00 -07:00
Ryan Macnak 813afcee43 [vm] Simulator support for Zicfilp.
TEST=ci
Change-Id: Ibf9adb39da37ebb350097e3830202940e138c7d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494860
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2026-04-13 14:00:21 -07:00
Konstantin Shcheglov bec97e984e CQ. Use public types as inputs, cast inside on entry.
Refactor `applicable_extensions.dart` so its public entry points accept
`DartType` and `ExtensionElement`, and perform implementation casts
internally at the analyzer boundary.

Remove the `strictCasts` parameter as well. Extension applicability
always ignores casts, so the parameter only added noise to the API and
to every call site.

Update completion and fix code in analysis_server to pass public types
directly and drop imports of internal analyzer type classes. Also
centralize the cast from `ExtensionElement` to `ExtensionElementImpl`
inside the helper instead of repeating it in multiple loops.

This makes the API cleaner, keeps the public/internal split in one
place, and reduces accidental coupling to analyzer implementation types.

Change-Id: I770ee5d8788f4c4a7004a0ad18a00cc52552e3b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494802
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-13 13:48:24 -07:00
Konstantin Shcheglov 1d69180201 Update package test to d0d5ccd037cb0eaea8e4dad900946ac54a4286c6, with analyzer 13 support.
Change-Id: I7354346986e223572906dd7190c79da96a4cb3b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494940
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-13 12:58:32 -07:00
Slava Egorov 3f9ae74880 Revert "[dart2wasm] Split patch files by whether they use JS interop"
This reverts commit 152cc247e0.

Reason for revert: Broken web_ui analysis (see flutter-analyze)

Original change's description:
> [dart2wasm] Split patch files by whether they use JS interop
>
> The eventual goal of the `dart2wasm_standalone` platform is to not rely
> on a JavaScript environment, which requires rewriting everything that
> currently relies on `js_interop` or `JS()` helpers.
>
> Since most of the patches are still written in Dart and we don't want
> to duplicate that code for the standalone target, this splits patch
> files by whether they rely on JS-interop or not. The main entrypoint
> for each patch (e.g. `lib/_internal/wasm/lib/core_patch.dart`) no
> longer relies on JS-interop and can safely be used in the standalone
> target. Part files that previously needed to use JS-interop have been
> moved into separate patches now, which allows us to migrate them
> incrementally.
>
> In some cases, it was easier to add new patch files:
>
> - Similar to the split between `boxed_int` and the `toString` helper
>   patch, we now have the same for `boxed_double`.
> - The functionality to copy from JS typed data wrappers into Dart typed
>   lists wouldn't work with standalone, so I've moved it into a separate
>   method we can patch to be a noop.
> - `dart:_wasm` exposes APIs to convert between `JSAny` and `externref`.
>   This is part of a public API, but I had to move those declarations
>   into a patch file because they wouldn't work with standalone.
>   Arguably, a separate library (`dart:_wasm_js_interop`?) would be
>   cleaner but it might be fine as long as `dart:_wasm` is experimental?
>
> For now, new patch files relying on JS interop are also applied to the
> standalone target. They are marked with a comment indicating that they
> need to be migrated though.
>
> Change-Id: I583f23f6cc1a3fc7332962292d69f3a7b0327409
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489660
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I21428bdabcabdbdd07f3453384bb31154083c8aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494920
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2026-04-13 10:26:58 -07:00
Ildeberto Vasconcelos ecc053009d [ linter] avoid bool literals in conditional expressions
Closes https://github.com/dart-lang/sdk/pull/63058

GitOrigin-RevId: af01893a30e86067f95ec6b781e9c47016912e83
Change-Id: I13957b5d2fcfe5eb9dedd84bf74f7ca64fd69706
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Connie Ooi <connieooi@google.com>
2026-04-13 10:22:33 -07:00
Ben Konyi fc3dbc7ef8 [ dart:io ] Fix bad type casts in network_profiling.dart
In 32e45cf300, types were updated from
Map<String, dynamic> to Map<String, Object> in some situations. These
two aren't compatible and can lead to runtime type cast failures.

This change fixes these cast failures and adds a regression test.

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

CoreLibraryReviewExempt: Only internal dart:io details.
Change-Id: I6684d447fc2fe98f9d54fb5bebc3e67f225fe5c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494680
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Elliott Brooks <elliottbrooks@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-04-13 10:17:53 -07:00
Slava Egorov fff4f2324d [vm] Remove _HashFieldBase
This class is structurally equivalent to _HashVMBase and the only reason
for it to exist for inability of normal Dart classes to extend
_HashVMBase - but this can worked around by properly configuring
_HashVMBase class in bootstrapping.

TEST=ci

Change-Id: I5ca401e274920d2b4739424c6b6595306a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494140
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2026-04-13 10:10:42 -07:00
Paul Berry 25bb8ce922 Add language tests for issues 33298 and 56666.
Yesterday I discovered some code in the front end type inference
engine that I didn't expect: logic that added constraints to type
inference based on the result of applying type coercions. To figure
out why it was necessary, I disabled it and ran the code through
trybots. It turns out that it's needed to prevent the following
issues:
- https://github.com/dart-lang/sdk/issues/33298
- https://github.com/dart-lang/sdk/issues/56666

Fortunately, we had regression tests for these issues:
- `pkg/front_end/testcases/general/bug33298.dart`
- `pkg/front_end/testcases/general/issue56666.dart`

Unfortunately, those regression tests are front-end specific, meaning
we didn't have any coverage for the analyzer.

This CL adds coverage for the analyzer by replicating the regression
tests in `tests/language`.

Change-Id: Ia53b3c898549e991d6685a414d177a466a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494563
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2026-04-13 09:30:21 -07:00
Paul Berry 00b6621e50 [front end] Add a rationale for a step in type inference.
Adds documentation of why it's necessary to feed the results of
coercions back into the type inference algorithm to generate
additional constraints.

(I was mystified by this logic, and had to try removing removing it in
order discover why it was needed.)

Change-Id: I26c40fb589e9db57deaf3dbad554353a6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494622
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-04-13 08:52:59 -07:00
Alexander Markov c3589b02b4 [vm] Verify there is no padding between last field and variable-length payload in the VM objects
The implicit padding would not be initialized but would
be scanned by GC.

TEST=Manually tested with implicit padding.

Change-Id: Ia3556d3e42a97fbb2d8f67541d2e7de9b7650077
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494566
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2026-04-13 08:52:24 -07:00
Sergey G. Grekhov 256878a672 [co19] Roll co19 to 4d90df49d4fc0d9aef3d3a0aed2bc0473fde81ef
2026-04-13 sgrekhov22@gmail.com dart-lang/co19#3315. Add missing experimental flag to `Language/Functions/Formal_Parameters/Optional_Formals/` tests (dart-lang/co19#3731)
2026-04-13 sgrekhov22@gmail.com dart-lang/co19#3203. Add VM debugger test for primary constructors of extension types (dart-lang/co19#3684)
2026-04-10 sgrekhov22@gmail.com Fixes dart-lang/co19#3728. Fix typos in syntax_t02.dart (dart-lang/co19#3729)
2026-04-10 sgrekhov22@gmail.com Fixes dart-lang/co19#3723. Add more tests for constants and ternary operator (dart-lang/co19#3724)
2026-04-10 sgrekhov22@gmail.com dart-lang/co19#3315. Add tests for `var` and `final` parameters of operators (dart-lang/co19#3727)
2026-04-10 sgrekhov22@gmail.com Fixes dart-lang/co19#3719. Update test in Language/Expressions/Bitwise_Expressions (dart-lang/co19#3720)
2026-04-10 sgrekhov22@gmail.com Fixes dart-lang/co19#3725. Fix the new roll failures (dart-lang/co19#3726)
2026-04-10 sgrekhov22@gmail.com dart-lang/co19#3315. Fix tests that use obsolete var syntax. Part 24. (dart-lang/co19#3721)
2026-04-10 sgrekhov22@gmail.com Fixes dart-lang/co19#3717. Fix expected error location in parameter_A06_t02.dart (dart-lang/co19#3722)
2026-04-09 sgrekhov22@gmail.com dart-lang/co19#3709. Fix failing tests, add issues numbers. Part 3. (dart-lang/co19#3718)
2026-04-08 sgrekhov22@gmail.com dart-lang/co19#3315. Fix tests that use obsolete var syntax. Part 23. (dart-lang/co19#3716)
2026-04-08 sgrekhov22@gmail.com Fixes dart-lang/co19#3714. Updated tests in `Language/Functions/Formal_Parameters/Optional_Formals` (dart-lang/co19#3715)
2026-04-07 sgrekhov22@gmail.com dart-lang/co19#3709. Fix failing tests, add issues numbers (dart-lang/co19#3710)
2026-04-07 sgrekhov22@gmail.com Fixes dart-lang/co19#3707. Add more tests for `continue` statement (dart-lang/co19#3708)
2026-04-07 sgrekhov22@gmail.com dart-lang/co19#3698. Update tests for `return` statement. Part 2. (dart-lang/co19#3705)
2026-04-07 sgrekhov22@gmail.com dart-lang/co19#3709. Fix failing tests, add issues numbers. Part 2. (dart-lang/co19#3712)
2026-04-07 sgrekhov22@gmail.com Fixes dart-lang/co19#3711. Update expected error location in static_processing_A03_t02.dart (dart-lang/co19#3713)
2026-04-01 sgrekhov22@gmail.com Fixes dart-lang/co19#3315. Add tests for metadata (dart-lang/co19#3704)
2026-04-01 sgrekhov22@gmail.com dart-lang/co19#3182. Add more tests for augmenting parameter with name `_`. Part 2. (dart-lang/co19#3697)
2026-04-01 sgrekhov22@gmail.com Fixes dart-lang/co19#3702. Fix/expect secondary errors in `grammar_A03_t02.dart` (dart-lang/co19#3703)
2026-04-01 sgrekhov22@gmail.com dart-lang/co19#3315. Add tests for primary constructors of mixin class (dart-lang/co19#3701)
2026-03-31 sgrekhov22@gmail.com dart-lang/co19#3315. Add tests for the syntax and for constant primary constructors (dart-lang/co19#3700)
2026-03-31 sgrekhov22@gmail.com dart-lang/co19#3698. Update tests for `return` statement. Part 1. (dart-lang/co19#3699)
2026-03-30 sgrekhov22@gmail.com dart-lang/co19#3182. Add more tests for augmenting parameter with the name `_` (dart-lang/co19#3696)
2026-03-30 sgrekhov22@gmail.com dart-lang/co19#3182. Revert tests for augmenting parameter with the name `_` (dart-lang/co19#3695)

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

Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,dart2js-minified-linux-d8-try
Change-Id: I1f57467f4665f37b301db3df3d8934db10afd695
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494820
Auto-Submit: Sergey Grekhov <sgrekhov22@gmail.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-04-13 08:16:43 -07:00
Simon Binder 152cc247e0 [dart2wasm] Split patch files by whether they use JS interop
The eventual goal of the `dart2wasm_standalone` platform is to not rely
on a JavaScript environment, which requires rewriting everything that
currently relies on `js_interop` or `JS()` helpers.

Since most of the patches are still written in Dart and we don't want
to duplicate that code for the standalone target, this splits patch
files by whether they rely on JS-interop or not. The main entrypoint
for each patch (e.g. `lib/_internal/wasm/lib/core_patch.dart`) no
longer relies on JS-interop and can safely be used in the standalone
target. Part files that previously needed to use JS-interop have been
moved into separate patches now, which allows us to migrate them
incrementally.

In some cases, it was easier to add new patch files:

- Similar to the split between `boxed_int` and the `toString` helper
  patch, we now have the same for `boxed_double`.
- The functionality to copy from JS typed data wrappers into Dart typed
  lists wouldn't work with standalone, so I've moved it into a separate
  method we can patch to be a noop.
- `dart:_wasm` exposes APIs to convert between `JSAny` and `externref`.
  This is part of a public API, but I had to move those declarations
  into a patch file because they wouldn't work with standalone.
  Arguably, a separate library (`dart:_wasm_js_interop`?) would be
  cleaner but it might be fine as long as `dart:_wasm` is experimental?

For now, new patch files relying on JS interop are also applied to the
standalone target. They are marked with a comment indicating that they
need to be migrated though.

Change-Id: I583f23f6cc1a3fc7332962292d69f3a7b0327409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489660
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2026-04-13 03:44:43 -07:00
Erik Ernst 56df2ae167 Adjust flow analysis to handle break/continue in an anonymous method
This CL changes the flow analysis slightly such that the analyzer is
able to handle a `break;`, `break L;`, `continue;`, or `continue L;`
that occurs in the body of an anonymous method. It adds a test for a few
situations where this feature is used.

Change-Id: I5b065a6ad96e346502fd071d1547ccd143f37e80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491800
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2026-04-13 01:06:01 -07:00
Brian Wilkerson e7136d4772 Update removeLeadingUnderscores for primary constructors
Closes https://github.com/dart-lang/sdk/issues/63077

Change-Id: Iee573f293edbaa011a1882b8b3cb110a643802fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494582
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-12 09:07:47 -07:00
Sam Rawlins 0dea8106e1 linter: Mark unnecessary_null_checks as stable
Fixes https://github.com/dart-lang/sdk/issues/58972

Change-Id: I57d24e106f5a908dc2d101d2f3a183b944145319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-11 10:17:44 -07:00
Konstantin Shcheglov c6135cbeef CQ. Rename AnalysisOptionsFile to AnalysisOptionsFileKeys.
I'd like to free this name for `AnalysisOptionsFile` data object.

Change-Id: Ie553ef30e9bef1e312e398248d66550ed289018c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494567
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-10 13:44:00 -07:00
Brian Wilkerson f62d10f40c Update the removeConstructorName fix to handle primary constructors
Closes https://github.com/dart-lang/sdk/issues/63072

Change-Id: I3391484a2693b0ec9f520353ac231ee0d9a60c7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494623
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-10 13:04:19 -07:00
Brian Wilkerson 0488d33502 Test that the makeRequiredNamedParametersFirst fix works with declaring parameters
Closes https://github.com/dart-lang/sdk/issues/63069

Change-Id: I589bfb659a4b96d7a2f029bb2dfd2e2b1ea7b9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494565
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-10 12:39:50 -07:00
Brian Wilkerson 0e570aacd6 Test that the convertToGenericFunctionSyntax fix works with primary constructors
Closes https://github.com/dart-lang/sdk/issues/63044

Change-Id: Ia1aefa1f93a30efa7c9f2f9c4d65664fb9ceb9ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494621
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-10 12:13:34 -07:00
Ben Konyi 5bb13f1788 [ Service ] Cleanup dart_runtime_service* logging and DDS state
A few minor changes:

 - Log output is now written to stderr.
 - `Service.controlWebServer`'s `silenceOutput` parameter is now
   respected, along with the `SILENT_OBSERVATORY`, `SILENT_VM_SERVICE`,
   and `SILENT_SERVICE` Dart defines.
 - DDS launcher state is cleaned up if the service server is shutdown
   via SIGQUIT.

Change-Id: I0e3e271905ad6bc111151bac086fe7661c23d578
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491280
Reviewed-by: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-04-10 12:04:28 -07:00
Ben Konyi a00e7d39dc [ Service ] Fix various tests for package:dart_runtime_service_vm
- Fixes issue where `streamListen(streamId: 'foo')` didn't result in an
  error when DDS was not present.
- Adds stub for the deprecated `streamCpuSamplesWithUserTag`

Change-Id: Ic18c2b24a103347eee60ee803a873f747dbfee7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/491200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jessy Yameogo <yjessy@google.com>
2026-04-10 12:04:28 -07:00