Commit graph

90729 commits

Author SHA1 Message Date
Kallen Tu 37c7f05a19 [analyzer] Report base/final subtype restriction error on mixin applications (class type aliases)
Bug: https://github.com/dart-lang/sdk/issues/51808
Change-Id: Ice44cce0ce2793fe578c327bb163e27533657fce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290343
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-22 19:35:50 +00:00
Konstantin Shcheglov ffcb4201ea Add 'augmentationImports' to LibraryOrAugmentationElementImpl children.
Change-Id: I55f7ece452a87b03439a185ad7170c728299b3f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290603
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-22 19:33:35 +00:00
Konstantin Shcheglov ca3e7a349e Update two more tests annotated with issue 51275.
Change-Id: Ia7c0468255b05d79f42cd48e6e455e67f09b7c43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290601
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-22 19:27:47 +00:00
Konstantin Shcheglov 812b607946 Fix for exhaustiveness and sealed mixins.
Change-Id: I50916e5e3337638ac55edace6e4f181c8e045a4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-22 19:25:31 +00:00
Chloe Stefantsova 2eba00fabb [cfe] Split ensureAssignableResult into coersion and error reporting
It allows to use coersion without error reporting in the inference of
record literals, which makes the difference when the record patterns
are involved.

Closes https://github.com/dart-lang/sdk/issues/51587

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

Change-Id: I64ea7e82eb3bc14d4410a47c6ed6ef278e092496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290529
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-22 17:21:45 +00:00
Paul Berry 6b4878b55f Front end: initial implementation of type inference for object patterns.
This code handles simple cases.  Still TBD:
- Object patterns that refer to typedefs
- Object patterns that refer to classes with f-bounded polymorphism
- Inference of `dynamic` when there is no bound

Bug: https://github.com/dart-lang/sdk/issues/51795
Change-Id: I00acae6ba111f7b170650cfeffbfd2aaf7f71e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290347
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-22 17:19:23 +00:00
Paul Berry 4caae04fc8 Remove the fallback exhaustiveness algorithm.
Fixes #51518.

Bug: https://github.com/dart-lang/sdk/issues/51518
Change-Id: Ic925f0ba41555e5077fee1b0433476e8ea28b75e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290560
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-03-22 17:13:19 +00:00
Danny Tuppeny 38f33d8ec8 [analysis_server] Cancel in-progress computation of fixes if another check starts
Change-Id: I3d2a740fbc077ba1707837bb9f2701de70da6ed7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-22 17:11:20 +00:00
Danny Tuppeny 99e630c638 [analysis_server] Don't suggest empty extension names in completion
Fixes https://github.com/Dart-Code/Dart-Code/issues/4451.

Change-Id: Id5e3b890470f4994f756c094fa782805678c6782
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290527
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-22 17:05:16 +00:00
Chloe Stefantsova 472968cda7 [cfe] Fix the subtyping case of FutureOr and RecordType
Closes https://github.com/dart-lang/sdk/issues/51731

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

Change-Id: Ie726f2f768df47fd00bd88af1f970ee3a86bf0a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290526
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-22 17:03:17 +00:00
Mark Zhou 6872707aa6 [ddc] Fixing switch label finder.
Our previous visitor was manually implemented. Extending the recursive visitor instead helps us be more robust to future CFE updates.

Fixes #51802

Change-Id: I9efebdf28fdf9146c2d1f948e01363a77807aa16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290280
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2023-03-22 16:35:18 +00:00
Johnni Winther 5d6e499c0d [cfe] Update expectations
This fell between commits.

Change-Id: Ie76f330f42ea8424704cc44490a573ca7879b40c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290525
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-22 15:53:00 +00:00
Ben Konyi 7767f9d9a6 [ dart:developer ] Apply class modifiers to dart:developer classes
None of the classes in dart:developer should be implemented or extended
as most functionality requires native calls into the VM.

TEST=N/A

CoreLibraryReviewExempt: No functional changes to implementations.
Change-Id: I6a8b819e8c9c771954009ffbb2e31f6d0f368c57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288823
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-22 15:34:59 +00:00
Lasse R.H. Nielsen 608934e330 Reland "Add class modifiers to dart:convert."
This is a reland of commit b2f4cf3e01

Commented out deprecation for now.

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>

CoreLibraryReviewExempt: Approved in original.
Change-Id: I1bc14f99b742567e2634dcfcbc52f332dbcc5364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290521
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-03-22 15:34:38 +00:00
Emmanuel Pellereau 7acb6f2c5c Revert "[vm] Refactor StubCodeCompiler to be a real class."
This reverts commit afdf640866.

Reason for revert: breaks google3. See b/274712076.

Original change's description:
> [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>

Change-Id: If36a9122e1a55d86673d05afbbd21dfb27d7acd5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290522
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-22 15:11:10 +00:00
Ryan Macnak e8b51c7375 Reland "[build] Handle cases for dart_target_arch != target_arch and target_cpu != host_cpu."
Fix target_cpu for "arm_x64" to be "arm" not "x64".

TEST=ci
Change-Id: Ifebaee036f3dfa5ba3824f05472423a5bcf9c0c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290360
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-03-22 14:57:27 +00:00
Joshua Litt 04896c7f90 [js] Add strict mode checks.
This CL adds support for strict mode, but disables it in tests and
allowed packages.

Change-Id: I834bc5a0e88868b282c3901361f7a90e1f9eeb3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289621
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-03-22 14:07:43 +00:00
Parker Lougheed 701a6a4299 Use an unnamed library declaration in 'dart create' package template
Change-Id: Ifff56e334d20f8938779cfdf18861d8ad9d5716c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289981
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2023-03-22 14:04:55 +00:00
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