Commit graph

90711 commits

Author SHA1 Message Date
Johnni Winther fd63f7ac64 [test] Add test for switch on values with primitive equality
Change-Id: I8de3234f1224e7b0e68b4c1ed190eaa49cbae68f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-22 13:54:52 +00:00
Martin Kustermann f20e6d3fa0 [vm] Remove complex logic in kernel loader for dealing with annotations
Instead of peeking into constant table and then delaying scanning of
constants by putting it in an array, which is walked again in some
future point, we simply read the annotation constants entirely without
requiring const evaluation. This works fine for pragma annotations the
VM is interested in - as there's no user-defined classes involved.

-> Loading kernel will no longer require constant evaluation to work.

Motivation for this is that [0] wants to make this delayed annotation
scanning logic even more complicated, so I prefer to remove it entirely.

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

TEST=ci

Change-Id: Ib859480107b6cf119d66035e66ec161ed11ddb32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290502
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-22 12:25:47 +00:00
Johnni Winther 94c165d189 [cfe] Implement primitive equality
Closes #51045
Closes #51565
Closes #51566
Closes #51688
Closes #51800

Change-Id: I4a679ef9cf496a22f4fdc2047a2dc4753e796e2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290320
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-22 12:25:41 +00:00
Johnni Winther f39f8f2f61 [cfe] Add implicit cast to dynamic guard
Closes #51724

Change-Id: I7db595557693addc31cbda4b70d00e1ba54671b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289906
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-22 11:01:28 +00:00
Johnni Winther 5493d42be3 [cfe] Throw error for null in non-nullable switch in weak mode
This adds thrown exception in weak-mode for exhaustive switch
expressions and statements to catch the unsound `null` values.

Closes #51769
Closes #51053

Change-Id: Ieb89e65f51e84853510fc320b64db01a80a262ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289600
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-22 10:30:24 +00:00
Johnni Winther 54d437cd7e [cfe] Add test for issue 51012
Closes #51012

Change-Id: I816b32daef41d305107a6fcba47ad3cb371c9a66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289903
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-22 08:53:45 +00:00
Liam Appelbe afdf640866 [vm] Refactor StubCodeCompiler to be a real class.
Previously, StubCodeCompiler was just a set of static methods, all of
which take an assembler as their first arg. This makes it hard to pass
additional state to the ~160 stub macro defined stub generators.

This refactor makes StubCodeCompiler a real class, with assembler as a
field. So we can easily add new fields to the class later, to pass new
state without having to update every stub generator.

assembler is declared as a public field for a few reasons:
- There's one place where it needs to be accessed by a non-member
  function (in the ia32 file).
- If it's private, it has to be named assembler_, which would mean a lot
  more insignificant diffs.
- Non-member functions that take assembler would have to take assembler_,
  for consistency with the __ macro, which would be weird.

Change-Id: I142f0803a07c7839753188065c69c334d4d1798a
TEST=CI
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289924
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2023-03-22 03:58:09 +00:00
Leaf Petersen ba9535fee8 Update tests of sealed mixin on type to reflect spec change.
As of https://github.com/dart-lang/language/pull/2889 it is an error
to declare a mixin with an `on` type which is declared in a different
library.

Change-Id: I02d6b3b6c203a46c74d2eacd006181db8e563726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290022
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-03-22 03:16:38 +00:00
Konstantin Shcheglov 38565dfe8b Use static MemoryByteStore for analysis server tests.
With this change it takes 150s vs. 220s without it.

Change-Id: I7097052a2520ba9b90da79c9263673dbc0a5705f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290345
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-22 01:18:39 +00:00
Janice Collins 00cf2e8311 Update dartdoc for the mixin-element changes.
Upcoming changes to the analyzer will result in compilation errors
in dartdoc without this change.

Change-Id: Ie80724fcfa6bc2b6fdfff3d851806669f9c20329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290401
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-22 00:53:34 +00:00
Konstantin Shcheglov 62cfd07b52 Prepare to publish analyzer 5.9.0 and _fe_analyzer_shared 57.0.0
Change-Id: Id583c0f5e0a9c2afb5af719a4d6964d8bdfd2346
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290342
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-22 00:36:06 +00:00
Jia Hao Goh 5921f835b6 [Runtime/VM] Enable SUPPORT_TIMELINE in product mode on iOS
This is useful to systrace release mode applications on iOS. With this change and with systrace disabled, the `TimelineEventNopRecorder` is used so there should not be any performance impact.

See also the following bug where this was done for Android.

TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/47264
Change-Id: If3d127054d6345213fe0ade827dd60f7904a99a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289925
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Jia Hao Goh <jiahaog@google.com>
2023-03-21 23:39:40 +00:00
Sam Rawlins 6ebf04576d [analyzer] Report invalid use of visibility-restricted elements in object patterns
Bug: https://github.com/dart-lang/sdk/issues/51750
Change-Id: Ifefddb398cc612eb8b5af1b945a2a2641ea960e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290264
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-21 23:34:05 +00:00
Alexander Aprelev f59e7d3aaa Revert "Add class modifiers to dart:convert."
This reverts commit b2f4cf3e01 because it breaks flutter analyze.

BUG=https://github.com/flutter/flutter/issues/123157

Original change's description:
> Add class modifiers to `dart:convert`.
>
> The usual approach:
> Pure interfaces marked `interface`.
> Pure implementation classes marked `final`.
> Base classes marked `base` or nothing, and `mixin class` if reasonable.
> Combined X/XBase/XMixin where possible.
>
> CoreLibraryReviewExempt: Aske is away
> Change-Id: I927f9bd488fb385ff9c17c8fc94920a1f5076347
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289200
> Reviewed-by: Stephen Adams <sra@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>

Change-Id: Ia79b9572e623a47ddbefd66efe270a6e3bbaa5e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290340
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2023-03-21 22:29:58 +00:00
Konstantin Shcheglov ae143b0201 Issue 51721. Update MakeFinal to support local variables with type annotations.
Bug: https://github.com/dart-lang/sdk/issues/51721
Change-Id: If99fa9e84eabe4099dcfa674540e27f323eddd65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290261
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 22:19:18 +00:00
Brian Quinlan 8384a13ec0 [doc] Document some limitations of Isolate.spawn.
Bug: https://github.com/dart-lang/sdk/issues/51594
Change-Id: Ib1aa733fd0f6641b53c32e9097f5b6e400226fa0
CoreLibraryReviewExempt: documentation only
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290262
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-03-21 22:08:03 +00:00
Sam Rawlins 6333e318cd [analyzer] Move 2 more Hints to be Warnings, DEAD_CODE*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Ie7a6cb94cefaf4f551ed766e637bac3606c0f5ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279463
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 21:55:08 +00:00
Konstantin Shcheglov c7c2be07d6 Sort a few files.
Change-Id: I4f1343a4b45ab2871ca7aa3a6eeb221072a3845d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290265
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 21:40:48 +00:00
Nate Bosch 4271aaacfd Bump test to cc0598b2c3bf3a7439f10f9542a8d01ff50b69e9
Changes:
```
> git log --format="%C(auto) %h %s" 3ba78f1..cc0598b
 https://dart.googlesource.com/test.git/+/cc0598b2 Move to `expect` from `package:matcher` (1969)
 https://dart.googlesource.com/test.git/+/0e5c028d Only use environment variable for chrome (1970)
 https://dart.googlesource.com/test.git/+/0b08d704 Add a hooks_testing library (1952)
 https://dart.googlesource.com/test.git/+/aacee2c7 Retry filesystem deletes (1965)

```

Diff: https://dart.googlesource.com/test.git/+/3ba78f15538399073d0b5aba4ec19b1378af1625..cc0598b2c3bf3a7439f10f9542a8d01ff50b69e9/
Change-Id: Iddfbc7d804a9864a77268fc0636a2962a2370e49
Tested: updated test expectations for content from the changed packages
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289886
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2023-03-21 21:37:57 +00:00
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