Commit graph

90642 commits

Author SHA1 Message Date
Paul Berry adbf363009 flow analysis: don't promote scrutinee of irrefutable patterns.
As discussed in
https://github.com/dart-lang/language/issues/2857#issuecomment-1458522087,
we only want a pattern match to promote the scrutinee in refutable
contexts (if-case and switch).

Bug: https://github.com/dart-lang/language/issues/2857, https://github.com/dart-lang/sdk/issues/50419
Change-Id: I187ef632e5da95b931e5cda34db06491a5228c98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-21 21:17:12 +00:00
Konstantin Shcheglov 38a2a91eaa Deprecate FunctionBody.isPotentiallyMutatedInClosure
Change-Id: I992ad2fbb91509a02c88f6842b72bc9c60e9e891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290182
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 20:45:08 +00:00
Ryan Macnak d8344d903e Revert "[build] Handle cases for dart_target_arch != target_arch and target_cpu != host_cpu."
This reverts commit 1acd4bef2f.

Reason for revert: Broke vm-aot-android-release-arm_x64

Original change's description:
> [build] Handle cases for dart_target_arch != target_arch and target_cpu != host_cpu.
>
> E.g., x64 Linux building a gen_snapshot that runs on an ARM Linux machine and targets Fuchsia x64.
>
> TEST=ci
> Change-Id: Id17a74d053a75c5e71c13cfe444374b638970e8a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289342
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Change-Id: Ie477216a9ffa59932f9bc7007f4ac2db1fafb51c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290341
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-03-21 20:43:16 +00:00
Leaf Petersen da7ef9a661 Tests for transitivity of base.
Test that all subtypes of classes marked base/final are required to be
base/final/sealed, and that base/final classes may not be implemented
outside of their own library.  Also test restrictions on sealed and
interface classes.

Change-Id: I15314a34b684bbec5a16b8ae228ca7de08f8498a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290100
Reviewed-by: Erik Ernst <eernst@google.com>
2023-03-21 20:31:00 +00:00
Danny Tuppeny ea775260be [analysis_server] Log errors parsing prompt preferences
+ some other minor tweaks from https://dart-review.googlesource.com/c/sdk/+/289601.

Change-Id: I401113b2adfba1d78250539f459028ad7051a591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 20:06:40 +00:00
Konstantin Shcheglov 156e8d6795 Remove deprecated RecordPatternField, used to transition linter.
Change-Id: I00410cd0dcce5b13d6b4c26e90f458b2e9f47bd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290183
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 19:47:37 +00:00
Ludi Zhan 0cb3a8f881 Support cascading @visibleForTemplate
Cascading @visibleForTemplate to class members and enum constants.

TEST=invalid_use_of_visible_for_template_member_test.dart

Change-Id: Ic79010e777626ff2b9bca7cdbcf4f9fb679e4456
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287671
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Ludi Zhan <ludizhan@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-03-21 19:39:34 +00:00
Jake Macdonald b165921081 [macros] change keyword getters to has* style names and fix up usages
Change-Id: I996b7cc2cd6e958c826db892978ea8de8bf78281
Bug: https://github.com/dart-lang/language/issues/2930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289902
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-21 19:36:54 +00:00
Danny Tuppeny ec335be378 [analysis_server] Allow immediate checking for "dart fix" prompt if context paths or their SDK constraints change
Change-Id: I432dbe19031c1aa4e409f930e7b913d8076a487a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290069
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 19:31:30 +00:00
Danny Tuppeny ee12bb3572 [analysis_server] Support multiple prefixes (and/or unprefixed) imports in ChangeBuilder
Change-Id: Ic73d93d7f1475c5eac21fa698181718c7e646b81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288780
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 19:21:22 +00:00
Robert Nystrom 5d858f01de Roll dart_style into the SDK.
This has two changes:

- Hide "--fix" in the help. The command is still fully supported, we
  just don't show it because we want to gradually migrate users to
  "dart fix".

- Remove support for the "interface", "final", and "sealed" modifiers
  on mixin declarations, since the proposal no longer supports those
  (and we need to remove them from the analyzer AST API).

There are no meaningful style changes, so there's no need to update the
pre-build SDK for this change.

Change-Id: I2357970e298a9be8f6f26efb5b922d40ee4fbb7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-03-21 19:05:06 +00:00
DEPS Autoroller 7e6e56b9b5 Roll Clang from 28ee6040710f to ee3efcf1bc8b
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/clang-dart-sdk
Please CC dart-engprod@google.com,dart-vm-gardener@grotations.appspotmail.com,dart-vm-team@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Clang: https://bugs.fuchsia.dev/p/fuchsia/issues/list?q=component%3AToolchain
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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

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-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
Change-Id: I4d880c62747c23d5a0933f61813e1a5535aa3997
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289480
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-03-21 18:53:48 +00:00
Danny Tuppeny 8696096afd [analysis_server] Prompt when there are issues that might be fixable by "dart fix"
Change-Id: Ibcc7a9b0b4258b0576e6f6e58bbb4b08987de0ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289601
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 17:05:39 +00:00
Konstantin Shcheglov 2a264085bd Implement navigation from PatternField.name to the referenced element.
See also https://github.com/dart-lang/sdk/issues/51797

Change-Id: I22b122a35b77ce40a73cc7d4bc8f295a5b9e4dc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 17:01:58 +00:00
Ryan Macnak 1acd4bef2f [build] Handle cases for dart_target_arch != target_arch and target_cpu != host_cpu.
E.g., x64 Linux building a gen_snapshot that runs on an ARM Linux machine and targets Fuchsia x64.

TEST=ci
Change-Id: Id17a74d053a75c5e71c13cfe444374b638970e8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289342
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-21 16:48:55 +00:00
Joshua Litt f49db09106 [js] Run web specific tests on Dart2Wasm.
Change-Id: I9facee2ae4357ed0b9f235d6951eafbae84f18dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289700
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-03-21 15:35:04 +00:00
Daco Harkes 92e5746494 Reland "[vm/ffi] Add class modifiers"
This is a reland of commit 1755f89092

Can land after (or with) the Flutter PR:
https://github.com/flutter/engine/pull/40434

Original change's description:
> [vm/ffi] Add class modifiers
>
> Adds class modifiers to `dart:ffi`.
>
> Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
> and `AbiSpecificInteger` to be `final class`es.
>
> Does not remove the manual error checking, so some errors will show up
> twice now in language version 3.0. In language version <3.0, only the
> FFI-specific error will show up.
>
> In a follow-up CL, we will try to make the language-errors to show up
> also <3.0 so that we can remove the FFI-specific errors.
>
> Examples of duplicated errors:
> pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart
>
> TEST=pkg/analyzer/test/ (for the analyzer)
> TEST=pkg/front_end/testcases/ (for the CFE)
> TEST=test/ffi/ (for the VM)
>
> CoreLibraryReviewExempt: No need for dart2js to review.
> Bug: https://github.com/dart-lang/sdk/issues/51683
> Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
> Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Devon Carew <devoncarew@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Jackson Gardner <jacksongardner@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)
CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2ee3f0ac31d4162068a2346a06320029b2263ee2
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289781
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 15:25:10 +00:00
Devon Carew 1ec61a0acb [pkg/dartdev] contribute a script to calculate and visualize the sdk size
Change-Id: I3167aa294ccfac4d002e30310a55edad4475b8d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289920
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-21 15:22:42 +00:00
Parker Lougheed cdc782e57b Use caret syntax for SDK constraint in dart create templates.
This has been allowed since 06ab0148b6.

Change-Id: Ibd202c7ed93dc147ead4fb58030c44f0a00ab352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289900
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-21 14:51:43 +00:00
Martin Kustermann 845c937c0b Revert "[vm] Mark _registerServiceExtension entrypoint conditional on being non-product mode"
This reverts commit 171744589a.

Reason for revert:

Flutter engine hasn't rolled into g3 yet. We need to wait
for it to roll into g3 to bring [0] in -  after which
running flutter from source in g3 no longer tries to
use this _registerServiceExtension entrypoint.

[0] e07fb9b5dd

Original change's description:
> [vm] Mark _registerServiceExtension entrypoint conditional on being non-product mode
>
> The runtime should only call this in non-product mode, we should be able
> to tree shake it in product mode.
>
> TEST=ci
>
> Change-Id: Ic8628b1e239f123894efc5a79253b8d6a9b56a73
> CoreLibraryReviewExempt: Doesn't change API
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289780
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>

Change-Id: If1342a51f2491cf81cd69fbc1de0b4549b1d8b98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290067
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-21 13:02:29 +00:00
William Hesse 84f9338346 Run analysis benchmarks twice on Windows builder
The Windows builder analyzer-win-release is waiting for shards
to complete after running the analysis server benchmarks, so we
can run the benchmarks twice to get more better results.

Bug: b/74375756
Change-Id: I03f459aece293a7e0b0eed3f4c52c037e2d9641c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290061
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-21 10:11:23 +00:00
Johnni Winther d7d0ffad66 [cfe] Add implicit cast to relational pattern
Closes #51789

Change-Id: I6c3e512b58f0216e0ba1c01812c92c2d1d9dbeaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289824
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-21 10:07:44 +00:00
William Hesse 20449a1ebc Revert "Reland "[io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes.""
This reverts commit e34165c543.
Also reverts commit 39ecf5f9d2

Reason for revert: breaks internal testing: b/274563167

Original change's description:
> Reland "[io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes."
>
> This is a reland of commit c2bdda63f5
>
> Original change's description:
> > [io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes.

Bug: b/274563167
Change-Id: I551c92a5fe121c85999f8a6ec513f83481ae2dbd
CoreLibraryReviewExempt: Revert
Tested: Revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290064
Auto-Submit: William Hesse <whesse@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-21 09:53:02 +00:00
Johnni Winther 6480e28d5a [cfe] Don't check length on List/Map only containing a rest pattern
Includes a fix for matched value type being invalid, encountered
during development.

Closes #51770

Change-Id: I0c960eaef528f16789e8d9a42340e50f05326cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289602
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-21 08:39:38 +00:00
Brian Quinlan d7c3ede476 Document the perils of closures with Isolate.run.
Bug: https://github.com/dart-lang/sdk/issues/51594
Change-Id: I71bfa4df139c185424e2d71da4f606eef062ffff
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288140
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-03-21 01:11:35 +00:00
Brian Wilkerson 101a2b4287 Add documentation for new diagnostics
I have not yet run the analyzer's generators just to keep the generated
version of the changes out of the review.

There are 10 parser diagnostics that are not being documented:
- ParserErrorCode.INVALID_CONSTANT_CONST_PREFIX
- ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY
- ParserErrorCode.INVALID_CONSTANT_PATTERN_DUPLICATE_CONST
- ParserErrorCode.INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL
- ParserErrorCode.INVALID_CONSTANT_PATTERN_GENERIC
- ParserErrorCode.INVALID_CONSTANT_PATTERN_NEGATION
- ParserErrorCode.INVALID_CONSTANT_PATTERN_UNARY
- ParserErrorCode.FINAL_MIXIN_CLASS
- ParserErrorCode.INTERFACE_MIXIN_CLASS
- ParserErrorCode.SEALED_MIXIN_CLASS

Let me know if you think any of those need documentation.

Change-Id: I904ecaeb07383fedcdc5c7c286f36d635ed8684e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286524
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 00:36:23 +00:00
Johnni Winther 7a09c1e472 [cfe] Update expectations
Merge conflict not caught by the trybot.

Change-Id: I41e419fb79e40a5ee1954e8e2e0b51dc63cd15da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289905
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-03-20 23:55:49 +00:00
Kallen Tu fde66e95bd [analyzer] Mark induced modifiers on sealed types.
Changed the classes to store induced modifiers on `isBase`, `isFinal`, and `isInterface`. If one of these getters are true and `isSealed` is true, then we assume it's an induced modifier. (Since a class or mixin cannot be both sealed and another modifier).

There's a subtle change here where the induced modifiers are only marked on sealed classes which means that classes that subclass/subtype non-sealed classes won't get any base or final errors. This will also affect how lints will be reported -- at the next erroneous subtype and not downstream from that type.

Also, the context messages now point to the class with the explicit modifier inciting the error.

Bug: #51671

Change-Id: I4c7541d956382dcb3917a4b8d73756840880c52f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289406
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-03-20 22:26:26 +00:00
Konstantin Shcheglov 1b5f1b2efc Issue 51773. Fix unnecessary_breaks quick fix when 'break' is on the same line as the previous statement.
Bug: https://github.com/dart-lang/sdk/issues/51773
Change-Id: I9e7297a5c1d584c5d4c043e66be23616924e416b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-20 21:57:52 +00:00
Konstantin Shcheglov af05d71857 Separate MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT from MIXIN_INHERITS_FROM_NOT_OBJECT.
Change-Id: I407540e20c1149203d1109920b3405d37df20423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-20 21:41:58 +00:00
Anna Gringauze b4a609ec3b [DDC] Use temporary names for synthesized CFE variables
Closes: https://github.com/dart-lang/sdk/issues/51589
Change-Id: I9d52b894419165f7e371c4e4fc56b81cb587d935
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288829
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2023-03-20 21:06:48 +00:00
Ryan Macnak 2cc96bfa0b [vm] Add an ABI for Fuchsia RISC-V.
https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0211_fuchsia_on_risc-v

TEST=./tools/build.py -mrelease -asimriscv64 gen_snapshot_fuchsia gen_snapshot_product_fuchsia
CoreLibraryReviewExempt: VM-only
Change-Id: Ie62addda6c15a5b44e814c49b543319aef4fc5e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281869
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-20 20:46:27 +00:00
Paul Berry bbc5ce328d flow analysis: eliminate unused field _scrutineeSsaNode.
This field is no longer used; the SSA node for the scrutinee is now
looked up using the scrutinee's promotion key.

Bug: https://github.com/dart-lang/sdk/issues/50419
Change-Id: I67768fa1311cecf62508844d3074758fbf55b426
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-20 20:30:11 +00:00
Konstantin Shcheglov 19e64e3dc1 Fix FunctionBody.isPotentiallyMutatedInScope() for 'PatternAssignment'.
Change-Id: I11eac50b22a82e2b3afe07ba886c28682f258752
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289884
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 20:14:47 +00:00
Konstantin Shcheglov 9674f63f13 Issue 51792. Simplify tests for FunctionExpressionInvocation on RecordType(s).
Bug: https://github.com/dart-lang/sdk/issues/51792
Change-Id: Ib63fa571905d41eed1f59e260bf47118ef1b05c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 20:10:19 +00:00
Derek Xu d7a26dc078 [VM/Service] Prevent VmServerConnection from converting SentinelExceptions into RPCErrors
TEST=CI, ran `flutter run -d chrome --debug` with the changes in this CL
applied to the vm_service directory in the pub cache and ensured that
this if-statement was entered
8679aeb235/packages/flutter_tools/lib/src/vmservice.dart (L1020-L1024)

Fixes: https://github.com/dart-lang/sdk/issues/51752
Change-Id: I2cec21bbb065b697fa34bd37c80b38f5eb9f493f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289940
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-03-20 20:03:48 +00:00
Johnni Winther 980486f386 [cfe] Add test for issue 50897
Closes #50897

Change-Id: Ic538d8cb1f7c3f5c09a6d1e2a9367577bb1856d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289820
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-20 19:58:47 +00:00
Brian Wilkerson 3a7c7909a2 Specify the message request for the legacy protocol
Change-Id: Iecfa9228f3f17451da3efb403f54a3be17166353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289541
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-20 19:26:07 +00:00
Nate Biggs 75be947317 [dart2js] Do some simple null safety clean ups.
- Mostly just removes asserts that are redundant with sound null safety. - Moves 3 classes `ClassRelation`, `DataSink` and `DataSource` back into their original files.
- Removes StrongModeConstraintInterface which was only needed for migration.
- Adds a couple simple late finals.

Change-Id: I921ac84a22cebd509f629f88be6bbb19d3c0a9e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289720
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-20 19:14:27 +00:00
Stephen Adams 73a8e6d970 [dart2js] Account for labels with switch-continue loops
A switch containing switch-continue statements is compiled to a loop
to re-enter the switch. This needs to be accounted for in determining
if a break or continue needs a label.

Fixes:
co19/Language/Statements/Continue/async_loops_t10
co19/Language/Statements/Labels/scope_t04

Bug: #51696
Bug: #48791
Bug: #46290

Change-Id: I4d96d2cb0958052c737b25f0ad55c3c350c304c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289660
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-03-20 18:56:38 +00:00
Danny Tuppeny 53319cf221 [dds/dap] Remove breakpoints and resume when trying to terminate test runs
Fixes https://github.com/Dart-Code/Dart-Code/issues/4447.

Change-Id: I9c18fccde101596135d3ea7324bbbd24fb5330c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289825
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-20 18:21:50 +00:00
Devon Carew 00972339e6 [pkg/vm_snapshot_analysis] update the readme for tool name changes
Change-Id: I0ea1f228d7d3405b0da24858fd5f03aa7e2c8ce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289442
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:57:51 +00:00
Devon Carew c61241f926 [deps] rev args, benchmark_harness, clock, csslib, dartdoc, protobuf, shelf, tools, vector_math, webdev, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

args (9305d5a..7a5e3b0):
  7a5e3b0  2023-03-14  Devon Carew  update readme; add contributing doc (#237)

benchmark_harness (a6a0891..725534a):
  725534a  2023-03-14  Kevin Moore  Spelling fixes, latest lints, move to minilibs (drop parts) (#85)

clock (5abb481..984642e):
  984642e  2023-03-15  Kevin Moore  Require Dart 2.19, use and fix recommended lints (#46)

csslib (b671738..d32bdd4):
  d32bdd4  2023-03-14  Devon Carew  refactor the package example (#170)

dartdoc (98fa859..7fde7a4):
  7fde7a4d  2023-03-13  dependabot[bot]  Bump github/codeql-action from 2.2.5 to 2.2.6 (#3363)

protobuf (75bc380..b90a4c4):
  b90a4c4  2023-03-16  Mahdi K. Fard  Sort message constructors first. (#807)
  00fd975  2023-03-15  Kevin Moore  Fix formatting with latest SDK (#808)
  a67bbb3  2023-03-15  dependabot[bot]  Bump actions/cache from 3.2.4 to 3.2.6 (#804)

shelf (e3cfe79..9a792b4):
  9a792b4  2023-03-13  Kevin Moore  Update format for latest v3 SDK (#340)
  c8094b7  2023-03-13  Kevin Moore  Update no-response.yml - once a day (#339)

tools (e5353aa..8d18d01):
  8d18d01  2023-03-15  Elias Yishak  Implement fake ga client (#37)

vector_math (1e4d000..7dec984):
  7dec984  2023-03-16  eoineoineoin  Add operator== to Quaternion (#288)

webdev (cfe9753..c2c8b17):
  c2c8b17  2023-03-16  Elliott Brooks (she/her)  Prepare Webdev version `3.0.2` for release (#2037)
  d124fa5  2023-03-16  Elliott Brooks (she/her)  Prepare extension for release (#2036)
  aef715d  2023-03-15  Elliott Brooks (she/her)  Prepare DWDS 18.0.1 for release (#2035)
  a15fde0  2023-03-15  Anna Gringauze  fix matching record types (#2032)
  05031da  2023-03-14  Anna Gringauze  Update build_daemon constraint and log errors (#2029)
  49013b8  2023-03-09  Elliott Brooks (she/her)  [MV3 Debug Extension] Fix authentication issue for the Dart Debug Extension (#2026)
  c8d4439  2023-03-09  Elliott Brooks (she/her)  Support `Set` inspection in DWDS (#2024)
  442639d  2023-03-08  Elliott Brooks (she/her)  Handle unexpected extension debugger disconnection events without crashing app (#2021)

yaml_edit (6abc42a..fbc5cb3):
  fbc5cb3  2023-03-09  Kevin Moore  Require Dart 2.19, update to latest lints
  c9e82f0  2023-03-09  Mohamed Ishad  Fix YamlEditor.update method leaving trailing spaces at eol (#42)

Change-Id: Icf15fc0ffd3ee36e0380751d18fd491de071040e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289881
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 17:45:37 +00:00
Srujan Gaddam 65e0bd3fca Reland "[dart:js_interop] Add literal constructors for inline classes"
This reverts commit 49f85335d5.

Reason for revert: Fixes the original breakage by adding an explicit
cast for the map function that's used to compute positional args
of the stub. Adds refactoring to better separate out the logic
between procedure-level and invocation-level lowering configs.

Also refactors optional argument functions so that they can use the
invocation-level lowering configs created in this CL. Also fixes
a small issue where object literal constructors wouldn't work in
dart2js if the surrounding library didn't have a @JS annotation.

Original change's description:
> Revert "[dart:js_interop] Add literal constructors for inline classes"
>
> This reverts commit 1f6d4ae1a8.
>
> Reason for revert: Broke Flutter with dart2wasm
>
> Original change's description:
> > [dart:js_interop] Add literal constructors for inline classes
> >
> > Adds @ObjectLiteral annotation to denote object literal constructors,
> > and implements it in all the backends. For dart2js, this involves
> > modifying the SSA and for dart2wasm, we create a one-per-shape
> > forwarding procedure to a specialized JS method that returns the
> > literal. This also modifies @anonymous semantics in dart2wasm to
> > be consistent with the other backends.
> >
> > CoreLibraryReviewExempt: Backend-specific, just adding annotation.
> > Change-Id: I4d7a9ea9ed097f4f378709b40f8bd74f02e26b23
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283922
> > Commit-Queue: Srujan Gaddam <srujzs@google.com>
> > Reviewed-by: Joshua Litt <joshualitt@google.com>
>
> Change-Id: Ifce611e1150d8aa275f9e312743bded56a572176
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285342
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

CoreLibraryReviewExempt: Reland.
Change-Id: Iac52e9ff152dc06788d78b7b18549c7005921b74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285346
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-03-20 17:41:49 +00:00
Nate Biggs 765dbf7f32 [dart2js] Stop emitting dill by default during global inference serialization.
This dill is a duplicate of the one emitted during closed world since the Kernel AST is not modified any more.

In case someone were to want to run the closed world and global inference phases together (e.g. `dart2js --write-data-uri=global.data main.dart`), keep the option to write the dill file with global inference results by allowing them to manually provide the `--out` flag.

Change-Id: Icac6a510ed74a6d095b54ba398897818f1a1efe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289581
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-20 17:37:34 +00:00
Devon Carew baff2375c3 [dds] updates to the dart devtools app size cli flags
Change-Id: I049a98452ec5f8e4e322e2cb9687aaa702819937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289449
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:33:46 +00:00
Jake Macdonald 2fc9ea5ad7 copy language/mixin tests to language/mixin_legacy with 2.19 opt out
Change-Id: Ice509ea1f0efec8153fb2380ab0e980fed552b0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289580
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-20 17:29:31 +00:00
Devon Carew d9fdec8129 [sdk] no longer generate <sdk>/lib/_internal/strong.sum
Change-Id: I54d9e8751508db2602a142d0977c4e3b9381ac33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289443
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-20 17:25:43 +00:00
Ben Konyi a62bfec074 [ Service ] Allow for case insensitive URI mappings on Windows and MacOS
The Windows and MacOS file system can be case insensitive, so the following
two URIs can be equivalent:

 - file:///c:/foo/bar
 - file:///C:/Foo/Bar

Since it's possible for tooling to request a mapping for a URI that
isn't an exact case-sensitive match to that found in the URI mappings
cache, requesting a mapping for the inexact match will fail even though
the paths are potentially equivalent.

This change allows for lookupPackageUris and lookupResolvedPackageUris
to correctly handle paths that are not case-sensitive matches to entries
in the URI mappings cache on Windows and MacOS.

TEST=uri_mappings_lookup_test.dart

Change-Id: I35134c47bf3bd04bc452373b31b4eb5893ba1435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288821
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-20 17:21:27 +00:00
Konstantin Shcheglov 4faf18deaf Issue 51718. Support for function expression invocation on RecordType(s).
Bug: https://github.com/dart-lang/sdk/issues/51718
Change-Id: I1f4b52eb6f5a741b77b2d1b5e7d9131531c4c00a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289740
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-20 16:03:11 +00:00