Commit Graph

49496 Commits

Author SHA1 Message Date
Srujan Gaddam e94de78d2b [ddc] Remove statements from the Fun returned by buildFunctionWithImports
This list of statements is intended to support additional
statements that need to be emitted to handle imports/exports.
For the incremental case, no non-import statements exist
and can be safely omitted from the body. We should be
intentional about including these if needed later to avoid
accidentally including unnecessary statements.

Change-Id: I726bb9e980d43c1edd1d0bda2d9be897586638ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393163
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-11-06 20:42:13 +00:00
Konstantin Shcheglov 09550b33fc Issue 57035. Fix for exception when asking class alias constructors.
Bug: https://github.com/dart-lang/sdk/issues/57035
Change-Id: I48aa20815b56c49f08e22509126f74891e694644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 20:24:39 +00:00
Alexander Markov a36dbc78ff [vm, dynamic_modules] Support loading of dynamic modules from unmodifiable view
TEST=pkg/dynamic_modules/test/data/load_unmodifiable_view
Fixes https://github.com/dart-lang/sdk/issues/57039

Change-Id: I5b04acd458da437b6ce4cf4b36e0c60c3d3458aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393920
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-11-06 20:23:58 +00:00
Sam Rawlins e66a8a4fa3 analyzer plugins: parse version and path keys in YAML
This enables plugin sources to be specified in one of three ways:

* as a YamlScalar, like `plugin_name: ^1.2.3`
* with a 'version' key, like `plugin_name:\n  version: ^1.2.3`, which
  allows diagnostic configurations to be alongside.
* with a 'path' key, like `plugin_name:\n  path: foo/bar`, which
  allows diagnostic configurations to be alongside.

We introduce a PluginSource with a `toYaml` method to convert the
values back into YAML for the generates pubspec. We update
PluginPackageGenerator to use PluginSource.toYaml.

Change-Id: Ic5f372f0339edd6aa638dd9b568a83f41a023b08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 19:41:00 +00:00
Robert Nystrom 732b07a42b Roll dart_style into the SDK.
I'm still chasing down a couple of google3 failures, but this is ready for review so that I can get it approved and land it once the last couple of failures are fixed. Here is who I think should review what:

athom@ for:

- DEPS

johnniwinther@ for:

- pkg/_fe_analyzer_shared
- pkg/front_end
- pkg/kernel

brianwilkerson@ for:

- pkg/analysis_server
- pkg/analyzer_plugin
- pkg/analyzer_utilities

kenzieschmoll@ for:

- pkg/dartdev

pquitslund@ for:

- pkg/linter/lib/src/lint_codes.g.dart

If you're not the right person, feel free to summon someone else.

Most of the changes here are re-running code generators that auto-format the code they generate. The changes are:

Roll in the latest dart_style commit:

- DEPS

Manually updated these test expectations to expect the new style:

- pkg/analysis_server/test/lsp/format_test.dart
- pkg/analysis_server/test/services/refactoring/agnostic/change_method_signature_test.dart
- pkg/analysis_server/test/src/domains/flutter/set_property_value_test.dart
- pkg/analysis_server/test/src/services/flutter/container_properties_test.dart
- pkg/analysis_server/test/src/services/flutter/widget_descriptions_test.dart
- pkg/analysis_server/test/src/services/refactoring/convert_selected_formal_parameters_to_named_test.dart
- pkg/analysis_server/test/src/services/refactoring/move_selected_formal_parameters_left_test.dart

This was auto-generated by something, but I'm not sure why it thinks there is a diff:

- pkg/analyzer_plugin/doc/api.html

Updated to require a version of dart_style that accepts a language version in DartFormatter():

- pkg/analyzer_plugin/pubspec.yaml

Updated to always use the latest language version (and thus new style) when invoking the formatter:

- pkg/analyzer_utilities/lib/tools.dart

Manually updated the formatting in the code templates so that they matched the formatting expected by the tests, which implicitly format using the latest language version:

- pkg/dartdev/lib/src/templates/...

The rest are all generated files that are formatted so re-generated using the new style:

- pkg/_fe_analyzer_shared/lib/src/experiments/flags.dart
- pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart
- pkg/analysis_server_client/lib/handler/notification_handler.dart
- pkg/analysis_server_client/lib/src/protocol/...
- pkg/analysis_server/lib/protocol/protocol_generated.dart
- pkg/analysis_server/test/integration/support/integration_test_methods.dart
- pkg/analysis_server/test/integration/support/protocol_matchers.dart
- pkg/analyzer_plugin/lib/protocol/...
- pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart
- pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart
- pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart
- pkg/analyzer/lib/src/dart/error/...
- pkg/analyzer/lib/src/error/codes.g.dart
- pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart
- pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart
- pkg/analyzer/lib/src/summary/format.dart
- pkg/analyzer/lib/src/wolf/ir/ir.g.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_000_1.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_001_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_010_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/less_simple/lib_100_0.dart
- pkg/compiler/test/tool/graph_isomorphizer/golden/simple/...
- pkg/front_end/lib/src/api_prototype/experimental_flags_generated.dart
- pkg/front_end/lib/src/codes/cfe_codes_generated.dart
- pkg/front_end/lib/src/util/parser_ast_helper.dart
- pkg/front_end/test/parser_test_listener.dart
- pkg/front_end/test/parser_test_parser.dart
- pkg/front_end/testcases/...
- pkg/kernel/lib/src/coverage.dart generated
- pkg/kernel/lib/src/equivalence.dart generated
- pkg/linter/lib/src/lint_codes.g.dart

Change-Id: Ice0141b763e63b84f54692cd19a442a0719673c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391263
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-06 18:42:25 +00:00
Parker Lougheed 2de5bb15f1 [linter] Changelog and since updates for 3.6 and 3.7
Change-Id: Ic308308ee7590a3dc10d84b4b33fa78ae4135a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393587
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 17:10:52 +00:00
Konstantin Shcheglov 03ad365274 Elements. Use firstFragment in TypeParameterElementImpl2 instead of wrappedElement.
Change-Id: Idf049d7f76d2c197bb6a98063bb7dd2a13c806aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393763
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 17:04:39 +00:00
Konstantin Shcheglov 4f20171f69 Elements. Use more impl in impl and tests.
Change-Id: Ibef3504c701fa3f37eb9078058113d8e44f05f04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393585
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-06 16:51:02 +00:00
Ömer Sinan Ağacan 76717f2930 [dart2wasm] Make int and double fields immutable
Make the `value` fields of `BoxedInt` and `BoxedDouble` `final`, to
generate immutable Wasm fields for them.

Immutable fields can potentially generate better code, as loads from the
same object will always generate the same value.

To allow making the `value` fields `final`, add a constructor.

To allow adding a constructor, "implement` base classes instead of
extending them. With `extends` the front-end wants us to call the
superclass constructors, even though they don't have any constructors.

This CL does not do the same to `BoxedBool`. We did that in a previous
iteration of the CL[1], but it caused regressions in post-TFA kernels.

[1]: https://dart-review.googlesource.com/c/sdk/+/393320

Change-Id: Ib44c25d09dcd84d999aa1d92dc9c38632454e443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393842
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-11-06 13:06:06 +00:00
Keerti Parthasarathy c30f961f13 Delete unused code - RuntimeCompletionComputer
Change-Id: I4fd027998ce4f9fa847df2ddd0773c3a476e766a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393701
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 12:59:00 +00:00
Keerti Parthasarathy da1930ab6c Add cancellation token for legacy requests in message scheduler
Change-Id: I6b0837edbf373d2b8b72b16ed47d157c097347d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-11-06 12:58:02 +00:00
Vyacheslav Egorov 3a895e28b4 [dart2native] Fix PE section injection
When writing out current PE contents only write data
up to `sectionTable.offsetEnd` because that is the
offset used to compute location of the snapshot
section and there might be a padding between
`offsetEnd` and the actual end of the file.

This was revealed when compiling AOT runtime
with ASAN enabled which slightly shifted
sections in the PE file and introduced
a gap.

TEST=manually internally

Change-Id: I532bc66fe5ac993c2214c22b50013e1a16c3f7f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393841
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-11-06 10:23:38 +00:00
Ömer Ağacan 95e7793b68 Revert "[dart2wasm] Make int, double, bool box fields immutable"
This reverts commit af2bea8162.

Reason for revert: Caused unexpected performance regressions.

Original change's description:
> [dart2wasm] Make int, double, bool box fields immutable
>
> Make the `value` fields of `BoxedInt`, `BoxedDouble` and `BoxedBool`
> `final`, to generate immutable Wasm fields for them.
>
> Immutable fields can potentially generate better code, as loads from the
> same object will always generate the same value.
>
> To allow making the `value` fields `final`, add a constructor.
>
> To allow adding a constructor, "implement` base classes instead of
> extending them. With `extends` the front-end wants us to call the
> superclass constructors, even though they don't have any constructors.
>
> Implementing `bool` (instead of extending) causes issues in TFA as it
> currently assumes bool literals are compiled as the `bool` class. Update
> TFA to treat bool literals the same way as `int` and `double` literals.
>
> Tested: existing tests
> Change-Id: I3282e188d784fa7a22421edc79ed47f9d85faf19
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393320
> Commit-Queue: Ömer Ağacan <omersa@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I8bb49bcc4bd9cd01f3e8a692d7ba1bef889ab555
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393840
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Ömer Ağacan <omersa@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-11-06 09:30:00 +00:00
Siva Annamalai 74c5aa3a7a Revert ""[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory""
This reverts commit f81a402aa1.

Reason for revert: golem benchmarks are failing to run

TEST=ci

Original change's description:
> "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime
>
> This reverts commit 75e6a748f7.
>
> TEST=ci
>
> Original change's description:
> > Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
> >
> > This reverts commit 1b331d05c2.
> >
> > Reason for revert: golem builds are failing
> >
> > Original change's description:
> > > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> > >
> > > TEST=ci
> > >
>
> Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: Iec494940412aa31dbefdc5280e35ae99e8cecb26
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393764
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-06 05:37:46 +00:00
asiva f81a402aa1 "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
Fixed golem breakage by temporarily copying dartaotruntime to dart_precompiled_runtime

This reverts commit 75e6a748f7.

TEST=ci

Original change's description:
> Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
>
> This reverts commit 1b331d05c2.
>
> Reason for revert: golem builds are failing
>
> Original change's description:
> > [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
> >
> > TEST=ci
> >

Change-Id: Id0f383eabb496c06c0acebc639c8e3b056ba82d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393781
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-06 03:10:31 +00:00
Srujan Gaddam 1d4c570dc5 Skip SDK library-level expression evaluation tests
These are no longer handled with the new module format,
so skip them when that's enabled. This is the last piece
to get expression evaluation tests working again with the
new format.

Change-Id: I92933363ea4e275f7a3f1c9cd62e24b0f7987f49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393162
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-11-05 23:51:42 +00:00
Siva Annamalai 75e6a748f7 Revert "[SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory"
This reverts commit 1b331d05c2.

Reason for revert: golem builds are failing

Original change's description:
> [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
>
> TEST=ci
>
> Change-Id: I96ed52994e0d955300c18026032e68003504666d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>

Change-Id: I5dc14973f4ee4e577b2c996839d5e497c97fb440
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393761
Commit-Queue: Siva Annamalai <asiva@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-05 21:58:09 +00:00
Sam Rawlins 1d947cedd2 Add new plugins to analysis options signature
Change-Id: Ia8600dfb33e8c65573d92b8643398488037ea63a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393602
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-11-05 21:02:59 +00:00
asiva 1b331d05c2 [SDK/VM] - Rename dart_precompiled_runtime to dartaotruntime, ensures we have a uniform name for the executable between the build directories and the SDK directory
TEST=ci

Change-Id: I96ed52994e0d955300c18026032e68003504666d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389760
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-11-05 20:39:15 +00:00
Parker Lougheed b47128dd64 [analysis server] Fix links in implementation docs
Change-Id: Ie40111a6bfed4a6f088f1e7bd3f365aa060a1b0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393700
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-11-05 19:25:00 +00:00
Kallen Tu 53bad058b1 [flow] Add unit test for postIncDec().
Add Flow Analysis unit tests for FlowAnalysis.postIncDec() which should be used for postfix increment and decrement operations.

Bug: https://github.com/dart-lang/language/issues/3658
Change-Id: If77b6fbb5fc80d5f5d014ec0516d77578446dced
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393441
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-11-05 18:54:02 +00:00
Konstantin Shcheglov 53bf3ff846 Elements. Rename to ClassElementImpl2, etc.
Change-Id: I94119f60b5bf01e52cf348a7c67f2b4a5ba62900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-05 18:42:21 +00:00
FMorschel 9d340db3e6 Fixes import prefix hover text as code
R=srawlins@google.com

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

Change-Id: I37fa39f385dd26dfcf55c024b9ca331ec83381f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393382
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-11-05 18:10:19 +00:00
Parker Lougheed 235a7157d5 [analysis_server] Don't repeatedly redetermine sort member order
Also complete some nearby cleanup. Mostly turning MemberKind into a normal enum.

Change-Id: I96f810c9f2197e5c748231f3d1fb5344e5ef528a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393680
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-05 17:29:29 +00:00
pq c37637c52d [element model] partially migrate ast utils
Change-Id: Ib4ad857a9828f798d44e549fde79303a446dfbc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-11-05 16:19:21 +00:00
Danny Tuppeny facc712ec8 [analysis_server] Migrate LSP colors to new element model
Change-Id: Ib31793e2cc5b52cde46b76dee9da7ddc9047eee3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393322
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-11-05 16:05:46 +00:00
FMorschel 6eda5e2019 [DAS] Fixes add const for final variables and lint
R=srawlins@google.com

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

Change-Id: I75dd2c0063ea5d3a6ebbf4afb734d2cb5d98c1d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392860
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-11-05 15:48:00 +00:00
Ömer Sinan Ağacan af2bea8162 [dart2wasm] Make int, double, bool box fields immutable
Make the `value` fields of `BoxedInt`, `BoxedDouble` and `BoxedBool`
`final`, to generate immutable Wasm fields for them.

Immutable fields can potentially generate better code, as loads from the
same object will always generate the same value.

To allow making the `value` fields `final`, add a constructor.

To allow adding a constructor, "implement` base classes instead of
extending them. With `extends` the front-end wants us to call the
superclass constructors, even though they don't have any constructors.

Implementing `bool` (instead of extending) causes issues in TFA as it
currently assumes bool literals are compiled as the `bool` class. Update
TFA to treat bool literals the same way as `int` and `double` literals.

Tested: existing tests
Change-Id: I3282e188d784fa7a22421edc79ed47f9d85faf19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393320
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-11-05 12:09:10 +00:00
Chloe Stefantsova 8a1c0203b4 [analyzer] Handle null-aware elements in code completion
Part of https://github.com/dart-lang/sdk/issues/56989

Change-Id: Id02c049d0afb5cb6c3f1d94ee5bebf7ca532e2e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392902
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-05 10:57:28 +00:00
Vyacheslav Egorov 729c1c01ce Fix Collect Report functionality
When language server is started through dartdev is gets
classified as a system isolate, but Collect Report
only looks at user isolates.

I have looked at various ways to fix this but it is
complicated because we are in the middle of rewiring
dartdev to work with AOT built tools.

I would like a trivial change that can be easily
cherry-picked into stable release. Thus I am opting in
to simply change data collection code to collect information
from both user and system isolates.

Change-Id: I00f9eb937153fc730feccf778e5cd2f69d222a18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-11-05 09:07:28 +00:00
Chloe Stefantsova 523ab95e64 [analyzer] Add call hierarchy tests for null-aware elements
Part of https://github.com/dart-lang/sdk/issues/56989

Change-Id: Ifd09b47fbb83519277fc6968a8edf8cdcdf76d6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393321
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-11-05 06:45:08 +00:00
Konstantin Shcheglov 7b9d11a6a4 Elements. Write mixins / interfaces / etc of InstanceElement2.
Change-Id: I402d76450bb06a74580292777dae4514c2685e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393580
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-05 02:36:18 +00:00
Konstantin Shcheglov 19cac1c907 Elements. Remove 'normalParameterNames' and 'optionalParameterNames' from FunctionType.
Change-Id: I934dca9f635411b71add032a3fc607dddf7de11a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393362
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-04 23:58:32 +00:00
Sam Rawlins 0ed2082654 analyzer plugins: change rules options key to diagnostics
Also allow warning diagnostics to be disabled.

In many places, the RuleConfig is unchanged because currently the
`linter/rules` section parsing is shared with the `plugin/<plugin-name>/diagnostics` section parsing.

They will probably diverge at some point, but as long as they are the
same, we can use the same Registry class to identify enabled and
disabled rules/diagnostics.

Change-Id: I9c00770af14d3b753532bcf1bc6bff62624d99ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-11-04 23:50:29 +00:00
pq c84515f419 [element model] migrate tool to opt-out semantics
See: https://dart-review.googlesource.com/c/sdk/+/393482

Change-Id: I08fc376892652699d1eed674d8267851e2c3a02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393483
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-04 22:49:20 +00:00
Konstantin Shcheglov f02000e8d2 Elements. Use analyzer_use_new_elements.txt for opt-out, not opt-in.
So, we can see what is left to migrate.

Change-Id: I2440e23bf9f02401278f15adca91080e584a694f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393482
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-04 22:38:38 +00:00
pq 5ce8de6dda [element model] migrate deprecated_consistency
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: Ice1e43981098dee54483696ac79518ef6c752bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393481
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-11-04 22:10:58 +00:00
Konstantin Shcheglov 4f6b07c25e CQ. Remove available declarations.
Bug: https://github.com/dart-lang/sdk/issues/55281
Change-Id: Ie8d2a7f3d5ea9408320312d49eb67561ca463289
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393480
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-04 21:30:08 +00:00
Konstantin Shcheglov c054056146 Elements. Lint. Disallow 'declaredElement' from src/dart/element/element.dart
Also enable the lint for analyzer/.

Change-Id: I2c9e61c6427f5e59b936f1ee7f5f94d4584f2988
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392851
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-04 20:59:51 +00:00
Sam Rawlins e33fad2eb0 linter: Simplify formatter hierarchy
Previously there was a `ReportFormatter` -> `SimpleFormatter`
-> `DetailedFormatter` hierarchy, but `DetailedFormatter` was the only class that was concretely instantiated. So we collapse these three
into one class. (`SimpleFormatter` was used in tests, but here we
convert those uses to use the remaining `ReportFormatter` class, and
use the `test_descriptor` package to allow that formatter to read
source files from disk, during the test.

Additionally, no arguments were passed for the `fileCount`, `fileRoot`,
or `machineOutput` constructor parameters, so those parameters and
corresponding fields are deleted.

Change-Id: I9d14acef7379325c42dcc729b9c77362ccd1aa86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392408
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-11-04 20:57:09 +00:00
Paul Berry 6ef2dbcb71 Introduce ExtensionResolutionResult for use by ExtensionMemberResolver.
Previously, `ExtensionMemberResolver` used `ResolutionResult` to
return its results. This created unnecessary complexity, because
`ResolutionResult` needs to be able to represent a lot of resolution
results that aren't possible when resolving extensions (references to
`Function.call`, references to record fields, and various complex
error reporting scenarios). Conversely, `ExtensionResolutionResult`
needs to be able to represent some scenarios that arent relevant when
doing non-extension resolution (extension lookup resulting in no
result or an ambiguous result).

Splitting into two classes makes both classes simpler.

In a few cases, code needs to be able to handle either a
`ResolutionResult` or an `ExtensionResolutionResult`; for these cases,
I've added a common base class `SimpleResolutionResult`.

This change paves the way for some clean-up work I'm doing on
`TypePropertyResolver` (which uses `ResolutionResult`).

Change-Id: I205251e43d7263cd2df7c729d1550dbb55980f62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393442
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-11-04 19:49:23 +00:00
pq 6523606849 [element model] fix unsafe member to ExecutableFragment cast
Fixes: https://github.com/dart-lang/sdk/issues/57022

Bug: https://github.com/dart-lang/sdk/issues/57022
Change-Id: Icb00f89089565679109b749d1a43d95f4c8b09b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393401
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-04 18:47:40 +00:00
Sam Rawlins 01c542c0c2 lint rules: Move the last of the unnecessary_parenthesis tests
Change-Id: I0f26dffc3a49b10542fdbbf444572810998ff552
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393360
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-04 17:32:01 +00:00
Konstantin Shcheglov 4096db4d51 Elements. Create loadLibrary() function with reference, lazily.
Related to https://dart-review.googlesource.com/c/sdk/+/393164

Change-Id: Ia448ff42c9de538be9a8f6f2101dff0c949671d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393260
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-04 17:19:46 +00:00
Moritz bc3a760f2b Record instances which are not annotations
There is no need to restrict the recording to annotations.
It also opens up more interesting use cases, for example recording instances of `const StringAsset('id').load()` if the class `StringAsset` has the `RecordUse` annotation.

Also includes a small refactoring in a separate commit.

TESTED=pkg/vm/testcases/transformations/record_use/instance_not_annotation.dart
Change-Id: I262995760a8ba8bc14c9cf01e5eb1b47f1278282
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387700
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-11-04 15:02:53 +00:00
Martin Kustermann c549a73d62 [deps] Roll dart-lang/native to new version
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Change-Id: I78f0ece02c337b3b132f161fa7cc5e88db223b57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389500
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Moritz Sümmermann <mosum@google.com>
2024-11-04 12:56:53 +00:00
Jens Johansen 817882c36b [parser] Recover missing identifier in new style typedef
Before, when parsing a new style typedef without an identifier (e.g.
`typedef = whatnot`) it concluded that the token after the equal-sign
wasn't an equal sign an that it thus had to be an old style typedef,
followed by recovery there.

This CL makes the recovery insert an identifier after `typedef` (what
the recovery of the old style actually did too), and then parse it as a
new style typedef.

This causes the previous many errors to just be `Expected an identifier,
but got '='.`

It is furthermore verified that the parsing of such a case is ~the same
as when having an indentifier.

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

Change-Id: I5cde1f29839555b1d6027a7d040dc6f60ac614a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392560
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-11-04 11:18:38 +00:00
Nicholas Shahan 5b6e6865b0 [ddc] Add test abstractions to hot reload suite
Provides a representation for all information needed to perform the
diff checks and run the tests. Uses classes as more structured
representation to ease an upcoming refactor where the entire suite
is not defined in the main method.

Only read and iterate and parse the file names a single time and collect
all needed information at this time.

Fixes `--debug` command line flag that was accidentally broken in
https://dart-review.googlesource.com/c/sdk/+/391686.

Change-Id: Ifb6005d85d79e1edb66473b3963cb800dc5e8569
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392404
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2024-11-02 00:03:42 +00:00
pq 7e353a3ac5 [element model] migrate prefer_final_parameters
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: Ia4dd49b4168d4223a27e81e66ca69249e2533cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393165
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-11-01 23:58:14 +00:00
Konstantin Shcheglov 1a0273672a Elements. Build TopLevelFunctionElementImpl during building elements.
Give it a reference.

Change-Id: Ie1189a18e9d2794d37e530cbbb01ddd86b78a16e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393164
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-01 22:21:00 +00:00