Commit graph

90403 commits

Author SHA1 Message Date
Lasse R.H. Nielsen 7d4ad1706e Adding class modifiers to dart:math.
Just adds `interface` modifier to `Random`.

Change-Id: I221a97a3c941befb9039a14d6ba827ab095837ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288207
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-03-13 14:01:26 +00:00
Sigurd Meldgaard 1e80548c5f Remove support for dart __deprecated_pub
This is no longer used after https://github.com/flutter/flutter/pull/121605

Change-Id: Ifc33004dd3a87612bf7b92a50587d68a37d629d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286927
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2023-03-13 12:06:08 +00:00
Sigurd Meldgaard ef8aaa3301 Reland "Bump pub to d69493e5163553bde53c0889b7479dee02f550bf"
This is a reland of commit a06ade1d14

Fix of flutter issue was landed here:
3f2cca8eeb

Original change's description:
> Bump pub to d69493e5163553bde53c0889b7479dee02f550bf
>
> Changes:
> ```
> > git log --format="%C(auto) %h %s" 048e3ad..d69493e
>  https://dart.googlesource.com/pub.git/+/d69493e5 Don't allow non-null-safety constraints in the root pubspec (3800)
>  https://dart.googlesource.com/pub.git/+/3514d7e7 Fail gracefully when tar file contains duplicate entries (3805)
>  https://dart.googlesource.com/pub.git/+/0b3b8b44 Give full error even in summary mode (3804)
>  https://dart.googlesource.com/pub.git/+/09c29722 Allow adding and removing dependency overrides (3716)
>  https://dart.googlesource.com/pub.git/+/7184d1b5 accept 'topics' property in pubspec.yaml (3796)
>  https://dart.googlesource.com/pub.git/+/cd106dfd Improve usage text of get (3792)
>  https://dart.googlesource.com/pub.git/+/019d61cb Handle bad git revisions (3791)
>  https://dart.googlesource.com/pub.git/+/e3ff7a99 Use 'pkg' and 'packages' to trigger suggestions for the pub command (3731)
>  https://dart.googlesource.com/pub.git/+/ea24bf22 Better error when path dependency has no pubspec.yaml (3787)
>  https://dart.googlesource.com/pub.git/+/da2a0144 Drop --use-data-isolate-strategy flag for tests (3788)
>  https://dart.googlesource.com/pub.git/+/a565858e Improve documentation of `pub token` and subcommands (3778)
>  https://dart.googlesource.com/pub.git/+/dd320459 Add test for publishing and consuming files with unicode characters in name (3785)
>  https://dart.googlesource.com/pub.git/+/c4226d9f Fail tests on errors thrown by test PackageServer (3784)
>  https://dart.googlesource.com/pub.git/+/12019939 Consider pubspec_overrides.yaml when publishing (3782)
>  https://dart.googlesource.com/pub.git/+/d8a97497 Allow addition of tokens for insecure localhost repositories (3777)
>
> ```
>
> Diff: https://dart.googlesource.com/pub.git/+/048e3ad2b5e1b4ebe6883addbc95722be6904a7b..d69493e5163553bde53c0889b7479dee02f550bf/
> Change-Id: I92af981e9cb6aaedfcd75a7327dfef071645306b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285908
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: William Hesse <whesse@google.com>

Change-Id: Ieeab0b4782afa216b353b91c57bde90957ce0aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288440
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2023-03-13 11:52:28 +00:00
Johnni Winther a811db5bc6 [cfe] Change MapPattern.key to Expression
The key can only be an Expression but was unneedingly wrapped in
a ConstantPattern. Since the shared type analysis only handles
map pattern keys as expressions, the expected properties of
ConstantPattern were not set. Amongst these were the static type
of the key expression, which is know passed directly to the
handleMapPatternEntry method.

Change-Id: I705fc655e440d534ccc442c9c1359c377955b3b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288282
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-13 10:05:16 +00:00
Johnni Winther f17cf33c6d [kernel] Move Pattern nodes to package:kernel
These AST nodes were so far internal to the CFE, but since we need to
move the pattern lowering to the constant evaluator we need to support them in the AST defined in package:kernel.

TEST=existing

Change-Id: Ie6c5f0f8ad75a866c5d965fdf506bc869ffaf654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288241
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-03-13 08:43:07 +00:00
Sergey G. Grekhov 16950643b4 [co19] Roll co19 to 5463a0b9331476a031714479f646a4c462ec9edb
2023-03-10 sgrekhov22@gmail.com dart-lang/co19#1401. Roll failures fixed (dart-lang/co19#1924)
2023-03-10 sgrekhov22@gmail.com Fixes dart-lang/co19#1918. Fix failures caused by class-modifiers (dart-lang/co19#1923)
2023-03-10 sgrekhov22@gmail.com Fixes dart-lang/co19#1919. Don't use Dart native classes for runtime type checks (dart-lang/co19#1922)
2023-03-10 sgrekhov22@gmail.com dart-lang/co19#1401. [Patterns] If case statement and element tests added (dart-lang/co19#1782)
2023-03-10 sgrekhov22@gmail.com Fixes dart-lang/co19#1917. Use `const(...)` for logical operator in switch (dart-lang/co19#1921)
2023-03-09 sgrekhov22@gmail.com dart-lang/co19#1401. Matching tests for identifier and parenthesized pattern (dart-lang/co19#1915)

Change-Id: Ieed796b37de7834a13272e061cf193951f64bef4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288243
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-03-13 08:22:24 +00:00
Alexander Markov 877245d705 [vm/tests] Update expectations for pkg/vm/test/transformations/type_flow/summary_collector_test
TEST=pkg/vm/test/transformations/type_flow/summary_collector_test
Closes https://github.com/dart-lang/sdk/issues/51692

Change-Id: Ib45863063e1d0f98355b627198ef309ef1672d21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288301
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2023-03-12 09:35:39 +00:00
Devon Carew d33ed63c11 [js_interop] adjust some dartdoc comments
Change-Id: Icba8e411ba0ec71acc4b7d5a9512f53182943c77
CoreLibraryReviewExempt: dartdoc comments for a web-only library
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288322
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-10 23:16:13 +00:00
Stephen Adams 1d4654c530 [dart2js] Make Record.runtimeType independent of field's .runtimeType
- Make Record.runtimeType independent of field's .runtimeType

- Display the record type of the irritant in TypeErrors rather than
  the confusing internal representation class name.

Bug: 51609
Change-Id: I95f35ecbaec9dff41f356e0994b2eadd397fbc1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287670
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-10 21:31:13 +00:00
Robert Nystrom 56eaffb392 [flip-patterns] Enable "records" and "patterns" experiment flags.
This turns on the flags for these two language features and makes
them generally accessible.

Doing so causes a number of tests to fail, but the failures are
approved and there are filed issues for them. Most of the
failures are minor or only affect code using the new language
features.

This CL:

- Enables the features in experimental_features.yaml.
- Re-generates all of the various files generated from that.
- Makes some analyzer and front end changes that this CL
  inherited from Paul's original CL flipping all of the 3.0
  feature flags. I don't know what these changes are about, but
  I assume they are necessary.
- Pins a couple of tests to 2.19 since they deliberately test
  behavior that is specific to 2.19. (For most test changes, I've
  landed them separately, but there are a couple of stragglers
  in this CL.)

This doesn't enable "class-modifiers" or "sealed-types" and doesn't
include the core lib changes related to those.

TEST=On bots

Change-Id: Id387753772286a958e20a3589a6e983995f2e4a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286344
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-10 20:02:23 +00:00
Konstantin Shcheglov af52197dd6 Replace declaredElementType with nested 'type' in expectations.
Change-Id: I4cd95528e24b0278f74e270e5685ef2d89d5e505
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288263
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-10 19:35:24 +00:00
Ben Konyi fadbd51c83 [ Service ] Remove unused variable in GetIsolateMetricList
TEST=N/A

Change-Id: I7e9eb8db64952a9f40d82514935beaced4bffdb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288102
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-03-10 18:35:43 +00:00
Jackson Gardner b890ed4cc3 Reland x3 [dart2wasm] Include wasm-opt in the shipped dart-sdk.
Hide this behind a flag, so that we can disable it when building in the flutter in-tree build.

The flag will be set to false for the in-tree flutter build, see
https://github.com/flutter/engine/pull/40195

Change-Id: I248376985d05bfb248a2eab6fa377cbb01d75654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288040
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-10 18:34:10 +00:00
Konstantin Shcheglov 6c7f3ab27d Revert "Use Feature to specify experiments."
This reverts commit fce81082c0.

Reason for revert: I changed my mind, specifically about using something else than `String` in `AnalysisOptionsFileConfig`.

Original change's description:
> Use Feature to specify experiments.
>
> Change-Id: Ide1a58c93cfc4920dff3ab2f52113434de93fff0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288162
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

Change-Id: Ib6eb1c04c099e318e935e9761f12bf35f561389f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288260
Auto-Submit: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-10 17:06:17 +00:00
Ben Konyi f51fedce26 [ dart:developer ] Remove Metrics related classes
Fixes https://github.com/dart-lang/sdk/issues/51668

TEST=CI

CoreLibraryReviewExempt:VM only functionality
Change-Id: I5d41863fca05e50d9c20266402c516b92f8de153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287820
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-03-10 16:50:10 +00:00
Konstantin Shcheglov fce81082c0 Use Feature to specify experiments.
Change-Id: Ide1a58c93cfc4920dff3ab2f52113434de93fff0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288162
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-10 16:14:38 +00:00
Danny Tuppeny c58d445fa8 [analysis_server] Insert "const" for const Color constructor calls for LSP color picker
Change-Id: I2b56d56624f657d190c788a0c6654e2f0040153c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287980
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-10 16:08:24 +00:00
Ben Konyi edead9cfd1 [ Observatory ] Disable serving Observatory by default
Observatory can still be enabled by providing `--serve-observatory` or
invoking the `_serveObservatory` private service RPC via web socket or
HTTP.

Related to https://github.com/dart-lang/sdk/issues/50233

TEST=pkg/dartdev/test/commands/run_test

Change-Id: I89b000e69bb31c91a9a5386fed1ee590cdafa58c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287821
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-03-10 16:01:41 +00:00
Erik Ernst 4751ed0bb8 Remove unused non-terminal
The non-terminal `patterns` is not used any more. This CL removes the
rule where it is introduced.

Change-Id: I2a8e957957d71999807a0e00fe102e61ed5ec173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288202
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-03-10 11:39:21 +00:00
Johnni Winther 04e6f4c282 [kernel] Add VariableDeclaration.isSynthesized
This adds an [isSynthesized] flag to the [VariableDeclaration] the
signal when the variable doesn't correspond to a variable in the
source code.

The name of a variable can only be `null` if it is synthesized.

Partially in response to
https://github.com/dart-lang/sdk/issues/51554

TEST=existing

Change-Id: I94591971f11da09d210c8b25a2d05e22ca05dc62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286961
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-03-10 11:13:36 +00:00
Ömer Sinan Ağacan 7b64d76b1d [dart2wasm] Fix const and non-const instantiation closure comparison
Fixes closure equality when one of the closures is const instantiation
and the other one is runtime instantiation.

New passing test: language/closure/identity_equality_tearoff_test

Change-Id: I4583f9823eb484425208c217a2df585c6fb56d70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287462
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-03-10 09:42:29 +00:00
Sigurd Meldgaard 46324e49da Revert "Bump pub to d69493e5163553bde53c0889b7479dee02f550bf"
This reverts commit a06ade1d14.

Reason for revert: Broke flutter: https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/flutter-engine-linux/19264/overview

Original change's description:
> Bump pub to d69493e5163553bde53c0889b7479dee02f550bf
>
> Changes:
> ```
> > git log --format="%C(auto) %h %s" 048e3ad..d69493e
>  https://dart.googlesource.com/pub.git/+/d69493e5 Don't allow non-null-safety constraints in the root pubspec (3800)
>  https://dart.googlesource.com/pub.git/+/3514d7e7 Fail gracefully when tar file contains duplicate entries (3805)
>  https://dart.googlesource.com/pub.git/+/0b3b8b44 Give full error even in summary mode (3804)
>  https://dart.googlesource.com/pub.git/+/09c29722 Allow adding and removing dependency overrides (3716)
>  https://dart.googlesource.com/pub.git/+/7184d1b5 accept 'topics' property in pubspec.yaml (3796)
>  https://dart.googlesource.com/pub.git/+/cd106dfd Improve usage text of get (3792)
>  https://dart.googlesource.com/pub.git/+/019d61cb Handle bad git revisions (3791)
>  https://dart.googlesource.com/pub.git/+/e3ff7a99 Use 'pkg' and 'packages' to trigger suggestions for the pub command (3731)
>  https://dart.googlesource.com/pub.git/+/ea24bf22 Better error when path dependency has no pubspec.yaml (3787)
>  https://dart.googlesource.com/pub.git/+/da2a0144 Drop --use-data-isolate-strategy flag for tests (3788)
>  https://dart.googlesource.com/pub.git/+/a565858e Improve documentation of `pub token` and subcommands (3778)
>  https://dart.googlesource.com/pub.git/+/dd320459 Add test for publishing and consuming files with unicode characters in name (3785)
>  https://dart.googlesource.com/pub.git/+/c4226d9f Fail tests on errors thrown by test PackageServer (3784)
>  https://dart.googlesource.com/pub.git/+/12019939 Consider pubspec_overrides.yaml when publishing (3782)
>  https://dart.googlesource.com/pub.git/+/d8a97497 Allow addition of tokens for insecure localhost repositories (3777)
>
> ```
>
> Diff: https://dart.googlesource.com/pub.git/+/048e3ad2b5e1b4ebe6883addbc95722be6904a7b..d69493e5163553bde53c0889b7479dee02f550bf/
> Change-Id: I92af981e9cb6aaedfcd75a7327dfef071645306b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285908
> Reviewed-by: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: William Hesse <whesse@google.com>

Change-Id: I0cb55a2cf4602868649c153dd1d86ba91c751ce5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288200
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Sigurd Meldgaard <sigurdm@google.com>
2023-03-10 08:17:17 +00:00
Konstantin Shcheglov c969a87222 Support for IndexExpression, don't report 'Enum.index'.
Change-Id: Ibd67955f9e6e70577d0b5e00edd513b05c5da406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288065
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-10 07:18:30 +00:00
Leaf Petersen 34531dcdf2 Tests for mixin class legacy interactions.
Change-Id: I2d2c3353f77b96d656bc81dc5f59bd7021ed2861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287665
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-03-10 06:02:34 +00:00
Jake Macdonald 737b6f7356 [flip-modifiers]: flip the flags for sealed classes and class modifiers
Includes several updates to tests that needed to land with this flip, as well as some other tests that needed to be updated and could land separately, but are being included here to expedite things.

Removes some unnecessary experimental release versions, as well as bringing up to date the generated files, which were previously out of sync with the yaml file.

TEST=bots

Change-Id: I71a86d7a86190069b504bd27d687f62b97a7251e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285080
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-03-10 05:27:57 +00:00
Stephen Adams 6ca7571e2b [benchmark] Benchmark for switch on various constant types
AOT:
SwitchFSM.enum(RunTime): 29.549523327947906 us.
SwitchFSM.int(RunTime): 37.73789702628717 us.
SwitchFSM.class(RunTime): 138.6418530572675 us.
SwitchFSM.string(RunTime): 797.54075 us.

dart2js+V8:
SwitchFSM.enum(RunTime): 31.484299349840917 us.
SwitchFSM.int(RunTime): 26.022895908416366 us.
SwitchFSM.class(RunTime): 91.67433302667894 us.
SwitchFSM.string(RunTime): 92.31338451577098 us.

Both AOT and dart2js are 'good at' switches on enum values.

When compiled with --enable-experiment=records,patterns:

AOT:
SwitchFSM.enum(RunTime): 141.75470079359405 us.
SwitchFSM.int(RunTime): 145.25322604030737 us.
SwitchFSM.class(RunTime): 138.45460840662005 us.
SwitchFSM.string(RunTime): 797.226 us.

dart2js+V8:
SwitchFSM.enum(RunTime): 98.93787283573403 us.
SwitchFSM.int(RunTime): 29.459852700736498 us.
SwitchFSM.class(RunTime): 98.62184338405162 us.
SwitchFSM.string(RunTime): 92.035889371936 us.

There is work to be done to recover the performance.

Change-Id: I1197129cb32615a06a63a05d7ba300b46c68b4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287246
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-10 04:21:13 +00:00
Robert Nystrom d52fe19dee Add tests for non-primitive equality in switch cases.
Even when a switch case only contains a constant (and not some more
complex pattern), Dart 3.0 changes the semantics and allows constants
of types that don't have primitive equality.

Add some tests for that.

Change-Id: Id3578d017822695451d7e44590fa349a8191a310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287663
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2023-03-10 02:39:28 +00:00
Konstantin Shcheglov 74fb9e190f Report RELATIONAL_PATTERN_ARGUMENT_TYPE_NOT_ASSIGNABLE instead.
Bug: https://github.com/dart-lang/sdk/issues/51679
Change-Id: Ia0655afa328dbc20ee7ee0fb62675a0f26f9be19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287940
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-10 01:56:23 +00:00
Alexander Markov d0024e9931 Enable patterns in IL comparison tests on Windows
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/287222
which enabled patterns experiment in compare_il script, but not
compare_il.bat.

TEST=ci

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

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-win-release-x64-try
Change-Id: I3a31339d6a17ef62a4b62340993fcff6f97373ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288067
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2023-03-10 01:14:18 +00:00
Nicholas Shahan ecd37e5d83 [ddc] Default native null asserts on in sound mode
This does not necessarily enable the native null assertions by default
everywhere but it is a step on the path to get there.

- The calls to the method that reads this value are only generated in
  sound null safety so even if this is true the checks don't happen
  in weak null safety. Added a warning when the option is enabled in
  weak null safety.
- Many DDC integrations will set the flag manually during the bootstrap.
  That setting still overrides the default value being changed here.

Change-Id: I4459fb8e8928424b461eb5519f3a7dc87c578172
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286606
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-09 23:43:49 +00:00
Nate Biggs 624fc6a9d6 [dart2js] Remove as checks where the expression is known to be null and the cast type is nullable.
Change-Id: I3f17a581d77bf4cfda90cf931c4bbdf0a53d0929
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286681
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-03-09 22:08:46 +00:00
Aske Simon Christensen c19720245c [dart2wasm] Categorize and masquerade runtime types by lookup table
This avoids virtual calls for `runtimeType` (unless the user overrides
it) and `_runtimeType` (since the internal categorization is now done
using the table instead), which saves a huge amount of space in the
global dispatch table.

It also fixes record runtime types, which now use the masqueraded
types for its fields, rather than the (possibly user-overridden)
`runtimeType`.

A masquerade case was missing for `Type`, which has been added.

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

Tested: ci + new test for overridden runtimeType
Change-Id: I1909c665ae78eb07b9c0eb22b6e8836e27495d70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285684
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-03-09 22:08:19 +00:00
Nate Biggs 9ba4957a31 [dart2js] Add record getters as reachable targets from dynamic call infrastructure.
Change-Id: I78387dffa4a7a16f20e630300bd90b08591efe6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287480
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-09 21:26:52 +00:00
Alexander Markov 8c7d47cd19 [vm/compiler] Keep and propagate static types during local type propagation
Types of record field accesses are based on static record types,
so it is useful to keep and propagate static types even when
concrete class id is known.

TEST=runtime/tests/vm/dart/records_field_operations_il_test.dart

Issue: https://github.com/dart-lang/sdk/issues/49719
Issue: https://github.com/dart-lang/sdk/issues/51637
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: I268e3d519b07e12d1e2f8929cbd704a6995e2053
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287222
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-09 21:18:49 +00:00
Sergey G. Grekhov f244d948c3 [co19] Roll co19 to 6472c72a65dac708a4f420666837a37c7ff4f54d
2023-03-09 sgrekhov22@gmail.com dart-lang/co19#1401. Matching tests added (dart-lang/co19#1894)
2023-03-09 sgrekhov22@gmail.com dart-lang/co19#1401. Type inference. The last part of the tests (dart-lang/co19#1859)
2023-03-09 sgrekhov22@gmail.com Fixes dart-lang/co19#1913. Update generated tests to work with class-modifiers (dart-lang/co19#1914)
2023-03-08 sgrekhov22@gmail.com Fixes dart-lang/co19#1909. Update tests not to fail with patterns feature enabled (dart-lang/co19#1910)
2023-03-08 sgrekhov22@gmail.com Fixes dart-lang/co19#1876. Don't expect type promotion in shared_case_scope_A02_t03 (dart-lang/co19#1880)
2023-03-08 sgrekhov22@gmail.com dart-lang/co19#1401. Pattern-for-in statement and element tests (dart-lang/co19#1872)
2023-03-08 sgrekhov22@gmail.com Added overloaded hashCode getter which is in accordance with == operator (dart-lang/co19#1911)
2023-03-08 sgrekhov22@gmail.com dart-lang/co19#1401. Execution of pattern-for statement and element. Switch expression (dart-lang/co19#1870)
2023-03-07 sgrekhov22@gmail.com dart-lang/co19#1401. Test for matching logical and relational patterns (dart-lang/co19#1888)
2023-03-07 sgrekhov22@gmail.com dart-lang/co19#1401. Pattern-if-case statement and element tests (dart-lang/co19#1873)
2023-03-07 sgrekhov22@gmail.com Fixes dart-lang/co19#1902. Existing tests adopted for patterns and records (dart-lang/co19#1908)
2023-03-07 sgrekhov22@gmail.com Fixes dart-lang/co19#1899. Language version 2.19 added to legacy mixins tests (dart-lang/co19#1907)
2023-03-06 sgrekhov22@gmail.com Fixes dart-lang/co19#1896. Update type inference tests failures (dart-lang/co19#1903)
2023-03-06 sgrekhov22@gmail.com Fixes dart-lang/co19#1901. Add `void` to prevent wrong failure (dart-lang/co19#1906)
2023-03-06 sgrekhov22@gmail.com Fixes dart-lang/co19#1897. Use <Object?> as an expected inferred type  for List and Maps (dart-lang/co19#1905)
2023-03-06 sgrekhov22@gmail.com Fixes dart-lang/co19#1895. Fix runtime type used in the test (dart-lang/co19#1904)

Change-Id: I4fc8fc07c2213f5fa05851db06bed3979d36ff52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287841
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-09 21:12:43 +00:00
Aske Simon Christensen c7432bf694 [dart2wasm] Workarounds to compile and run flute
Change-Id: I9180a2a65d47b11ec5e13d9c003c10b428bc15fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287540
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-03-09 21:10:45 +00:00
Konstantin Shcheglov 3f0c013779 Switch DeprecatedMemberUseFromSamePackage_BasicWorkspaceTest to the latest feature set.
Change-Id: Ia38ad1a8cb445385cdf68636d07d571e4105d0e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287920
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-09 19:55:34 +00:00
Konstantin Shcheglov 895540889e Update SDK constraints for SDK packages.
https://dart-review.googlesource.com/c/sdk/+/287660 implements it.
I want to fix pre-existing violations before enabling.

Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: Ie7731162c643018a2312b265f444bc00534c0a51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287664
Reviewed-by: Leon Senft <leonsenft@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-09 19:52:47 +00:00
Devon Carew 9e80e7edfd [deps] rev test, tools, webdev, yaml, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

test (92da93a..3ba78f1):
  3ba78f15  2023-03-07  Bartek Pacia  fix typo in architecture.md (#1966)

tools (a1c3506..bed358e):
  bed358e  2023-03-07  Devon Carew  rev to 0.1.0 (#29)

webdev (c007560..cfe9753):
  cfe9753  2023-03-07  Elliott Brooks (she/her)  Update `dev` versions of DWDS and Webdev (#2022)
  c37d419  2023-03-07  Daniel Chevalier  Fix for listening to custom streams in DWDS. (#2011)

yaml (a6d8781..1ad2f49):
  0f80b12  revert updating the type for YamlScalar.value (#139)
  1ad2f49  2023-03-01  Kevin Moore  Require Dart 2.19, migrate to dart_flutter_team_lints, make associated fixes (#138)
  4d369fd  2023-03-01  Kevin Moore  benchmark: fix output.json (#137)

yaml_edit (998eea2..6abc42a):
  6abc42a  2023-03-08  Devon Carew  updates for the next version of package:yaml (#45)
  48e5868  2023-03-08  Kevin Moore  blast_repo fixes (#46)
  aaa1d53  2023-03-02  Jonas Finnemann Jensen  Add code coverage (#38)
  0668eb5  2023-03-02  Jonas Finnemann Jensen  Wrap recursively, prepare release (#28)
  a4ff857  2023-03-01  Mohamed Ishad  Update CHANGELOG.md (#37)
  2fdfbdb  2023-02-28  Mohamed Ishad  Fix for issue #23 (#34)
  494ad7c  2023-02-25  MikiPaul  fixed typo (#36)

Change-Id: I3aee0b2f84e97cf4f1131c002bb4e84ab8ffcc92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287560
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-09 19:24:20 +00:00
Robert Nystrom bb3fc88eb0 [flip-patterns] Pin to tests/vm/dart/regress_flutter51298_test.dart to 2.19.
In Dart 3.0, bool is treated as an "always-exhaustive" type which means
it's a compile error to not exhaustively switch on it.

Since this is a regression test, I don't want to tweak the test and
risk not covering the regressed behavior, so pinning to 2.19 where this
wasn't a compile error.

Change-Id: I51c63730f6db55ecc52daf20888db8778051d98f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287668
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-03-09 19:22:47 +00:00
Konstantin Shcheglov 10ee5fdf94 Implement reporting WarningCode.SDK_VERSION_SINCE
It is not enabled by default yet, because there are existing violations.

Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: I60147d4c240d63d2f631513c8dfbd4917c35d47c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287660
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-09 18:59:27 +00:00
Kallen Tu 919eb05b27 [analyzer] Avoid reporting subtype modifier errors on final supertypes outside of library.
Change-Id: If4fba1c08d7dc9d4f65ea56760298e47c65742fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-09 18:09:34 +00:00
Derek Xu d029b866f4 Bump protobuf-gn
Our "all" build targets were actually broken by protobuf-gn at revision
5f87ef9990fc4f4ffd76b3f5b0138562178db8bc, and got fixed again at
revision 390a1c9bd6fe63f0ca474ac1bc1bc23033e1ecf8. This updates our dep
to a revision newer than 390a1c9bd6fe63f0ca474ac1bc1bc23033e1ecf8.

Change-Id: Ibc60e7067e01702a3ae120bbbbb7a603fcad6f47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287621
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-03-09 17:38:59 +00:00
Johnni Winther eaedc90684 [_fe_analyzer_shared] Improve handling of map patterns
This adds improved support for map patterns. A new [Restriction]
class replaces the [TypeBasedStaticType.identity] properties and
allows not only for unique values as subtypes but also subsets of
values as subtypes. For map pattern the subsets are defined by
a [MapTypeIdentity] based on the type arguments of the map pattern,
its constant key values and whether it has a rest pattern.

Change-Id: I32b95f519cc161975af17ea82beacbc27ad5bbe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-03-09 17:22:36 +00:00
Konstantin Shcheglov 04f7a2a910 Simplify implementation of FindNode.singleX getters.
Change-Id: I434cf2371dee4269747b21413d6d15cbd4fa4e3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287672
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-09 17:00:48 +00:00
Chloe Stefantsova b16acf4f35 [cfe] Provide pre-desugaring node to flow analysis to fix promotion
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I2a70518975c809f28f0d0f72f7365492ca7d6e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287601
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-09 15:58:49 +00:00
Lasse R.H. Nielsen c974c70f31 Add boolean parse
Closes https://github.com/dart-lang/sdk/pull/51026

Co-authored-by: Renato Burton <renatoburton96@gmail.com>
GitOrigin-RevId: e85a56ce338476b38eac890fac2b8ca193ca42e8
Change-Id: I60f92c594830ef0438ecd92b4c83cec609054326
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279746
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-03-09 15:14:32 +00:00
Modestas Valauskas e0fedb81a1 Replace identifierNotFUNCTION with identifier.
Closes https://github.com/dart-lang/sdk/pull/51675

GitOrigin-RevId: 420ce80ffed652776cc612aaa7209a81df4fe222
Change-Id: I870ffe0d63eb0bbcbfe8f5db6be940c6a470750d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287667
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2023-03-09 14:50:46 +00:00
Sigurd Meldgaard a06ade1d14 Bump pub to d69493e5163553bde53c0889b7479dee02f550bf
Changes:
```
> git log --format="%C(auto) %h %s" 048e3ad..d69493e
 https://dart.googlesource.com/pub.git/+/d69493e5 Don't allow non-null-safety constraints in the root pubspec (3800)
 https://dart.googlesource.com/pub.git/+/3514d7e7 Fail gracefully when tar file contains duplicate entries (3805)
 https://dart.googlesource.com/pub.git/+/0b3b8b44 Give full error even in summary mode (3804)
 https://dart.googlesource.com/pub.git/+/09c29722 Allow adding and removing dependency overrides (3716)
 https://dart.googlesource.com/pub.git/+/7184d1b5 accept 'topics' property in pubspec.yaml (3796)
 https://dart.googlesource.com/pub.git/+/cd106dfd Improve usage text of get (3792)
 https://dart.googlesource.com/pub.git/+/019d61cb Handle bad git revisions (3791)
 https://dart.googlesource.com/pub.git/+/e3ff7a99 Use 'pkg' and 'packages' to trigger suggestions for the pub command (3731)
 https://dart.googlesource.com/pub.git/+/ea24bf22 Better error when path dependency has no pubspec.yaml (3787)
 https://dart.googlesource.com/pub.git/+/da2a0144 Drop --use-data-isolate-strategy flag for tests (3788)
 https://dart.googlesource.com/pub.git/+/a565858e Improve documentation of `pub token` and subcommands (3778)
 https://dart.googlesource.com/pub.git/+/dd320459 Add test for publishing and consuming files with unicode characters in name (3785)
 https://dart.googlesource.com/pub.git/+/c4226d9f Fail tests on errors thrown by test PackageServer (3784)
 https://dart.googlesource.com/pub.git/+/12019939 Consider pubspec_overrides.yaml when publishing (3782)
 https://dart.googlesource.com/pub.git/+/d8a97497 Allow addition of tokens for insecure localhost repositories (3777)

```

Diff: https://dart.googlesource.com/pub.git/+/048e3ad2b5e1b4ebe6883addbc95722be6904a7b..d69493e5163553bde53c0889b7479dee02f550bf/
Change-Id: I92af981e9cb6aaedfcd75a7327dfef071645306b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285908
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-03-09 13:48:51 +00:00
Oleh Prypin 732d1cc0a4 Revert "Add more interface and final modifiers to dart:core."
This reverts commit 4f8333e80e.

Reason for revert: causes breakages in google3

Original change's description:
> Add more `interface` and `final` modifiers to `dart:core`.
>
> Make intent explicit for classes which are intended as interfaces,
> or which are not intended to be subclassed.
>
> Mainly classes which are pure interfaces are marked as such,
> and platform-specific classes not intended for subclassing
> are made `final`.
>
> The `final` classes includes `BigInt`, which is written to assume
> that arguments inherit its private members
> (it runs `_ensureSystemBigInt` on arguments).
>
> It also includes the `Expando`, `WeakReference` and `Finalizer` classes,
> which are just intended as stand-alone implementation classes for accessing
> platform-specific functionality.
>
> Change-Id: Ib770c265edff127a289a67fe72d15b9ff0499407
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287180
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I94ff95f72410a4e1ae80744971c4c920fecc1493
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287760
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Oleh Prypin <oprypin@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-09 13:09:57 +00:00