Commit graph

90383 commits

Author SHA1 Message Date
Ö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
Lasse R.H. Nielsen 4f8333e80e 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>
2023-03-09 12:31:08 +00:00
Chloe Stefantsova 615e44821a [cfe] Support private field names in object patterns
Part of https://github.com/dart-lang/sdk/issues/49749

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

Change-Id: I712ad8b5aa87a27614f76da42fb10d4c9e9a03da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287740
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-09 11:53:29 +00:00
lauren n. liberda d9e8662145 fix //build/config/linux/pkg_config.gni
Closes https://github.com/dart-lang/sdk/pull/51614

GitOrigin-RevId: eeb9417653fcdda384bd26de58b3cf2b508be348
Change-Id: I0b9d3b06afdad29667281403e646edc4a06a2b0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286603
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-03-09 11:44:44 +00:00
Brian Wilkerson e2d8a5e66e Compute and report to analytics the flutter version
Change-Id: I1432d52f0708370cfe78accb216d93de4ce4479a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287244
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-03-09 05:02:39 +00:00
Alexander Aprelev 63bea106d6 [vm/regexp] Name generated Regexp function with actual expression.
Currently all generated Regexp functions share the same name making profile information with RegExp functions harder to use.

BUG=https://github.com/dart-lang/sdk/issues/51624
TEST=ci

Change-Id: I67acf73df4be301dbcb17a60b8be1793002897b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287247
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-03-09 03:49:58 +00:00
Robert Nystrom 2496c1a69a [flip-patterns] Fix web switch tests.
Update two tests to Dart 3.0 semantics:

- Switch case constants can be types that don't have primitive equality.
- Switch cases don't need breaks.

Change-Id: Icdea5b66cf12f675580a85b9d49c09db589e29d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287400
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-03-09 01:13:09 +00:00
Konstantin Shcheglov b1b1f47b95 Issue 51561. Fix for a mixin field inference.
Bug: https://github.com/dart-lang/sdk/issues/51561
Change-Id: Ie8654a4e3bb73dd41c7f6fa291fe531a5dcc9fa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287641
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-08 22:45:15 +00:00
Brian Quinlan b04cb92b73 Await the benchmark reports
Change-Id: I9de7fdbadcf454b1d2069580a0e5c96722b3c7ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287620
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-03-08 22:38:21 +00:00
Ryan Macnak 5c76d099a6 [build] Use relative paths.
go/remotely-cacheable

TEST=ci
Change-Id: Idee4ab56de2df15e90c5e4106b6200bf82e76155
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287320
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-08 22:10:42 +00:00
Keerti Parthasarathy a94d2e277c Wire up another case for add_const fix.
Bug: 49960
Change-Id: I2b18aaab92c012c01485f3b73f47c80f134f1f1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-03-08 22:06:39 +00:00
Alexander Markov 8ff777e61f [vm] Fix equality of uninstantiated generic closures
Equality of uninstantiated generic closures should match equality
of corresponding instantiated generic closures.

We cannot use identity for equality of instantiated generic closures
as distinct instantiations of the same generic closure should be equal.
So, identity shouldn't be used for uninstantiated generic closures
neither.

This change fixes equality for uninstantiated generic closures
and also updates closure hashCode correspondingly.

TEST=language/closure/instantiation_closure_equality_test
TEST=co19/LanguageFeatures/Constructor-tear-offs/equality_*

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

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Ieafc052de4a4f5f9ffcd2d9d26cb36a209c0e127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287581
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2023-03-08 21:44:56 +00:00
Konstantin Shcheglov 18d414d24d Add 'get sinceSdkVersion' to Element.
Bug: https://github.com/dart-lang/sdk/issues/34978
Change-Id: Ibabcbb9f4dcd5ecb0300af05a494dc2e5af14fb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287241
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-08 20:29:57 +00:00
Konstantin Shcheglov 424d56f34c Class modifiers changes for mock SDK, fixes for analyzer, analysis_server tests.
Some of these changes were in the flip CL.
https://dart-review.googlesource.com/c/sdk/+/285080

Change-Id: I3f9d7905aeaedc25f2008410a2b48ff74ef2d74f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287420
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-08 18:31:31 +00:00
Aske Simon Christensen 4733f9b754 [dart2wasm] Fix accesses to type arguments in sync* functions
Fixes the `Iteration` benchmark.

Change-Id: I947c413524a3d55d19f56d0bfbb45dc5125e972a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287467
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-03-08 17:02:22 +00:00
Kallen Tu 9e1c3b4c26 [flip-modifiers] Make tests and outline extraction tests mixins.
Change-Id: Ic0d393eb1df282f25cfa45ee81ef5ccffef3060a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287242
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-08 16:11:30 +00:00
Aske Simon Christensen f288058d6b [dart2wasm] Enable records and patterns in benchmarks
Also omit debug info from the Binaryen output, since we are not using it
for anything and the upcoming code size benchmarks will need it removed
anyway.

Change-Id: I57ddd7c8f1fa8ed725a69ed36e949109742da75d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287466
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-03-08 15:52:13 +00:00
Ömer Sinan Ağacan 979e8dc932 [dart2wasm] Fix instantiation closure equality
The test fails in VM, which is reported as #51660.

Change-Id: Icb0f5493f282aa017980478a038b48dd09c5030c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286933
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-03-08 15:42:26 +00:00
Daco Harkes 11929b6f68 [vm/ffi] Change late Finalizable implementation #2
https://dart-review.googlesource.com/c/sdk/+/286782 omitted to treat
captured variables.

We should treat captured variables the same as other variables. We
might decide to inline the body of a closure, in which case we should
not eagerly execute initializer statements for fences.

TEST=pkg/vm/testcases/transformations/ffi/finalizable_late_initializer.dart

Closes: https://github.com/dart-lang/sdk/issues/51511
Change-Id: I80744d347926087f467c561d76eca17d3a108983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287460
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2023-03-08 15:40:52 +00:00
Konstantin Shcheglov 6e019dcd0b Rename resolution tests to AstNodeNameResolutionTest style.
Any variations are after 'Test', e.g. 'TypeNameResolutionTest_WithoutNullSafety'.

Change-Id: If3316cabf058936dedc294c85b4b9417a6923ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287248
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-08 15:20:08 +00:00
Ömer Sinan Ağacan fa90dcc640 [dart2wasm] Fix awaiting non-future values
New passing tests:

- co19/Language/Statements/For/Asynchronous_For_in/execution_A05_t05
- language/async/await_test/02
- language/async/await_test/03
- language/async/await_test/none
- language/await/nonfuture_test
- language/await/started_immediately_test

Change-Id: I5d5e13f846aa2415abb9788ef341b1d86170937c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286921
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-03-08 14:53:40 +00:00