Commit graph

22382 commits

Author SHA1 Message Date
Robert Nystrom c89ec96b96 Fix int-to-double test to work on the web.
Change-Id: I5e208edc53543de8d11aa6e81072ad7f61a23d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290913
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2023-03-23 22:47:49 +00:00
Kallen Tu 66c1b0db50 [analyzer] Report an error when implementing a base class through a sealed class.
Bug: https://github.com/dart-lang/sdk/issues/51810
Change-Id: I478eff8484fa5d3bddfb9cf1c744e6d65a72f6c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-23 22:06:01 +00:00
Paul Berry c358118e9f When type inference fails for object patterns, fall back on instantiate-to-bounds
(As discussed in https://github.com/dart-lang/language/issues/2770#issuecomment-1479624850)

Fortunately this was easy to do because we already have the necessary
logic to fall back on instantiate-to-bounds when type inference fails;
it's a standard part of the "upwards inference" algorithm.

Bug: https://github.com/dart-lang/language/issues/2770, https://github.com/dart-lang/sdk/issues/51795
Change-Id: I91847fc01d1420e6bfb584e8536ebca803133bd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290613
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-23 13:13:20 +00:00
Emmanuel Pellereau d0556f9c27 Revert "Reland "Add class modifiers to dart:convert.""
This reverts commit 608934e330.

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

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

Change-Id: Ie438531e9b97658c86e242fabddbb8a2919f634b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290763
Reviewed-by: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Oleh Prypin <oprypin@google.com>
Commit-Queue: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-23 12:19:33 +00:00
Joshua Litt 884f42a4f4 [js_util] Make callMethod take an Object method.
CoreLibraryReviewExempt: Minor refactor of web only library.
Change-Id: I7afc4a00501ac12c1aa0248305001a978f2e9f8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288641
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-03-23 00:23:00 +00:00
Kallen Tu c7cee7fd46 [tests] Update tests where analyzer mixin applications were failing.
Bug: https://github.com/dart-lang/sdk/issues/51808
Change-Id: I0c3951ab28f96cf1794e0ac1088c975c11935bf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290660
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-03-22 22:51:34 +00:00
Stephen Adams 7675d887b3 Add test for http://dartbug.com/51527
Test currently fails on both DDC and dart2js

Bug: 51527
Change-Id: I229d5c9ba518d3323f98312f13740711523439e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290350
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-22 20:09:03 +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
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
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
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
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
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 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
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
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
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
Ryan Macnak 1acd4bef2f [build] Handle cases for dart_target_arch != target_arch and target_cpu != host_cpu.
E.g., x64 Linux building a gen_snapshot that runs on an ARM Linux machine and targets Fuchsia x64.

TEST=ci
Change-Id: Id17a74d053a75c5e71c13cfe444374b638970e8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289342
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-21 16:48:55 +00:00
Daco Harkes 92e5746494 Reland "[vm/ffi] Add class modifiers"
This is a reland of commit 1755f89092

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

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

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)
CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2ee3f0ac31d4162068a2346a06320029b2263ee2
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289781
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-21 15:25:10 +00:00
William Hesse 20449a1ebc Revert "Reland "[io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes.""
This reverts commit e34165c543.
Also reverts commit 39ecf5f9d2

Reason for revert: breaks internal testing: b/274563167

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

Bug: b/274563167
Change-Id: I551c92a5fe121c85999f8a6ec513f83481ae2dbd
CoreLibraryReviewExempt: Revert
Tested: Revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290064
Auto-Submit: William Hesse <whesse@google.com>
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-21 09:53:02 +00:00
Brian Wilkerson 101a2b4287 Add documentation for new diagnostics
I have not yet run the analyzer's generators just to keep the generated
version of the changes out of the review.

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

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

Change-Id: I904ecaeb07383fedcdc5c7c286f36d635ed8684e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286524
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-21 00:36:23 +00:00
Kallen Tu fde66e95bd [analyzer] Mark induced modifiers on sealed types.
Changed the classes to store induced modifiers on `isBase`, `isFinal`, and `isInterface`. If one of these getters are true and `isSealed` is true, then we assume it's an induced modifier. (Since a class or mixin cannot be both sealed and another modifier).

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

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

Bug: #51671

Change-Id: I4c7541d956382dcb3917a4b8d73756840880c52f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289406
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-03-20 22:26:26 +00:00
Konstantin Shcheglov af05d71857 Separate MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT from MIXIN_INHERITS_FROM_NOT_OBJECT.
Change-Id: I407540e20c1149203d1109920b3405d37df20423
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-20 21:41:58 +00:00
Srujan Gaddam 65e0bd3fca Reland "[dart:js_interop] Add literal constructors for inline classes"
This reverts commit 49f85335d5.

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

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

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

CoreLibraryReviewExempt: Reland.
Change-Id: Iac52e9ff152dc06788d78b7b18549c7005921b74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285346
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-03-20 17:41:49 +00:00
Jake Macdonald 2fc9ea5ad7 copy language/mixin tests to language/mixin_legacy with 2.19 opt out
Change-Id: Ice509ea1f0efec8153fb2380ab0e980fed552b0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289580
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-20 17:29:31 +00:00
William Hesse 39ecf5f9d2 [io] Calling flush after close on File.open's IOSync should not throw an exception
The documentation of IOSync states that calling flush on a closed IOSink may have no effect:
https://github.com/dart-lang/sdk/blob/main/sdk/lib/io/io_sink.dart#L109
The future returned by close in the new implementation does not complete until after
a call to flush has completed.
The previous implementation of File.open did not throw when calling flush after close.

CoreLibraryReviewExempt: IO only, restoring previous semantics
Bug: b/274405250
Change-Id: I56bbe02e886085cc8156e60264f5b77593c8a075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289823
Reviewed-by: Emmanuel Pellereau <emmanuelp@google.com>
2023-03-20 15:33:04 +00:00
Lasse R.H. Nielsen b2f4cf3e01 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>
2023-03-20 13:27:17 +00:00
Zach Anderson 7471994270 Revert "[vm/ffi] Add class modifiers"
This reverts commit 1755f89092.

Reason for revert: This is a breaking change and is blocking the Dart -> Flutter roll. See https://ci.chromium.org/ui/p/flutter/builders/try/Mac%20Unopt/26896/overview.

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

Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: Ie5b8a08aea6d64b1991ace4814322b21ffb670c7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289640
Commit-Queue: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-03-20 11:15:59 +00:00
Robert Nystrom 10f53cb4c6 Remove incorrect part of int-to-double test.
Switch statements on ints aren't required to be exhaustive.

Change-Id: I85701b098cacf9d01241dab821ae4c70f04a0710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289450
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-03-18 01:54:56 +00:00
Robert Nystrom 6de72778ff Add tests for where coercions do and don't happen in patterns.
These tests reflect the intended behavior after
https://github.com/dart-lang/language/pull/2926 lands.

Change-Id: I7ce1991dfc9b247b0c6ce6ee2714b5f207a4040d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289404
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2023-03-17 23:04:25 +00:00
Mayank Patke 0d583f707c [dart2js] Add failing test for issue #49588.
Bug: #49588
Change-Id: If19b956642ff55ca6d54e7b9df21cbc516d05d93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253710
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2023-03-17 21:32:22 +00:00
Nicholas Shahan bd62be296c [tests] Avoid imports across null safety suites
Updates imports in `tests/lib_2` from `tests/language` to use the
version in `tests/language_2` instead.

I think it is also a little awkward to import libraries across
tests suites period but that is an issue for another day.

Change-Id: Ib61bb1e1790926f92ee2650a6497916f2edce7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289407
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-17 20:03:37 +00:00
Daco Harkes 1755f89092 [vm/ffi] Add class modifiers
Adds class modifiers to `dart:ffi`.

Migrates all user-defined subclasses of `Struct`, `Union`, `Opaque`,
and `AbiSpecificInteger` to be `final class`es.

Does not remove the manual error checking, so some errors will show up
twice now in language version 3.0. In language version <3.0, only the
FFI-specific error will show up.

In a follow-up CL, we will try to make the language-errors to show up
also <3.0 so that we can remove the FFI-specific errors.

Examples of duplicated errors:
pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart

TEST=pkg/analyzer/test/ (for the analyzer)
TEST=pkg/front_end/testcases/ (for the CFE)
TEST=test/ffi/ (for the VM)

CoreLibraryReviewExempt: No need for dart2js to review.
Bug: https://github.com/dart-lang/sdk/issues/51683
Change-Id: I2964ceccb7db59fbdaf6be5319f5e4ec2dabe0f3
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-win-release-try,pkg-mac-release-try,vm-precomp-ffi-qemu-linux-release-riscv64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-reload-rollback-linux-debug-x64-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289223
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-03-17 19:29:41 +00:00
Jake Macdonald 2cec283bd0 update covariant setter test to test mixin class behavior also
Change-Id: I8f87f5d2d7745719462e0782176b04a595cdd5f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289521
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-17 17:38:49 +00:00
Johnni Winther 7cc2553fa1 [_fe_shared_analyzer] Use real exhaustiveness checking algorithm
This changes the analyzer and CFE to use the real exhaustiveness
checking algorithm. The fallback algorithm is kept and will be
removed once we know that the real exhaustiveness algorithm sticks.

Change-Id: Ic9df92c1ca9f7dec4cbdfa138dc6ed39ef2d4df5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-17 16:45:35 +00:00
Jake Macdonald 3b06df241f Clean up a number of 2.19 opt outs in language tests.
This is less than half of them, will send some other chunks later.

Bug:51557
Change-Id: I4e80812a689fde99e23c34b6405aaf57cd431ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289261
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-17 16:17:50 +00:00
Brian Quinlan e34165c543 Reland "[io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes."
This is a reland of commit c2bdda63f5

Original change's description:
> [io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes.
>
> Benchmarks (benchmarks/FileIOSink/dart/FileIOSink.dart):
>
>  @before:
>
>   FileIOSink.Add.ManySmall(RunTime): 2341597.0 us.
>   FileIOSink.Add.OneLarge(RunTime): 111.06925927974774 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 105.65958788898234 us.
>
>  @after
>
>   FileIOSink.Add.ManySmall(RunTime): 5007.1125 us.
>   FileIOSink.Add.OneLarge(RunTime): 98.23492468475541 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 91.77411527720551 us.
>
> So the relative performance changes are:
>
>  FileIOSink.Add.ManySmall(RunTime): 0.00213x (MUCH faster)
>  FileIOSink.Add.OneLarge(RunTime): 0.884x (slight faster - noise?)
>  FileIOSink.Add.AlternatingAddSize(RunTime): 0.868x (slightly faster - noise?)
>
> https://golem.corp.goog/Revision?repository=dart&revision=102771&patch=17842
>
> Change-Id: Ic73f33299a570096dd05f254982f556767559966
> Bug:https://github.com/dart-lang/sdk/issues/32874
> Tested: unit tests
> CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285420
> Commit-Queue: Brian Quinlan <bquinlan@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

Bug: https://github.com/dart-lang/sdk/issues/32874
Change-Id: I758f3159e85c837d6ec4a0f3e470b519825ee142
Tested: unit tests
CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288545
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-03-17 16:13:19 +00:00
Nate Biggs 21737a6c2e [dart2js] Fix type variable detection for interfaces nested in records for RTI.
Change-Id: I9661498582eb170077eb3d58d8a84fab2e2d8bf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289380
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-17 03:30:14 +00:00
Stephen Adams e4ec7d1588 [dart2js] Handle accesses to uninstantiated record shapes
Bug: #51725
Change-Id: I80758d0b19641f12534df10c54d78836b7b4c61e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288604
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-03-14 20:38:47 +00:00
Kallen Tu 08c492f119 [cfe] Allowing pre-feature libraries to mix in classes in core libraries.
Also, quickly fixes sealed error along the way.

Change-Id: Id40e86a434d2d3930ae69d9ee2c7ffe6fc4cb0e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287921
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-14 18:28:42 +00:00
Johnni Winther e54fdb19a1 [cfe] Use library features for allow patterns in the parser
The parser used the global features and not the library features to
determine whether pattern syntax should be expected.

Closes #51625
Closes #51626

Change-Id: I3adc05468c0f9d2c5b919dc7fa12a5de4dcbbc7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288504
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-14 11:37:28 +00:00
Siva Annamalai c17e55a1de Revert "[io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes."
This reverts commit c2bdda63f5.

Reason for revert: We are seeing some windows failures and also 
Bad state: /tmp/file_test_NOYTEV/foo is bound to a stream
** Note that stack traces are truncated. See http://go/dart-chain-stack-traces for information on how to view the full stack trace **
dart:io                                                          _RandomAccessFileIOSync.flush


Original change's description:
> [io] Improve the performance of the IOSink returned by `openWrite` by writing eagerly and accumulating small writes.
>
> Benchmarks (benchmarks/FileIOSink/dart/FileIOSink.dart):
>
>  @before:
>
>   FileIOSink.Add.ManySmall(RunTime): 2341597.0 us.
>   FileIOSink.Add.OneLarge(RunTime): 111.06925927974774 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 105.65958788898234 us.
>
>  @after
>
>   FileIOSink.Add.ManySmall(RunTime): 5007.1125 us.
>   FileIOSink.Add.OneLarge(RunTime): 98.23492468475541 us.
>   FileIOSink.Add.AlternatingAddSize(RunTime): 91.77411527720551 us.
>
> So the relative performance changes are:
>
>  FileIOSink.Add.ManySmall(RunTime): 0.00213x (MUCH faster)
>  FileIOSink.Add.OneLarge(RunTime): 0.884x (slight faster - noise?)
>  FileIOSink.Add.AlternatingAddSize(RunTime): 0.868x (slightly faster - noise?)
>
> https://golem.corp.goog/Revision?repository=dart&revision=102771&patch=17842
>
> Change-Id: Ic73f33299a570096dd05f254982f556767559966
> Bug:https://github.com/dart-lang/sdk/issues/32874
> Tested: unit tests
> CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285420
> Commit-Queue: Brian Quinlan <bquinlan@google.com>
> Reviewed-by: Alexander Aprelev <aam@google.com>

Bug: https://github.com/dart-lang/sdk/issues/32874
Change-Id: I6e16cfb460a9a6b16d7a63cb02d46fab9fc6244d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288606
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-03-14 04:54:17 +00:00
Joshua Litt e4bf05fd47 [js_util] fix Dart2Wasm patch file.
Change-Id: Icc98e6d1fd65ccdc8b9bc2a8b109140d53b18662
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288161
Auto-Submit: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-03-14 01:43:50 +00:00
Brian Quinlan c2bdda63f5 [io] Improve the performance of the IOSink returned by openWrite by writing eagerly and accumulating small writes.
Benchmarks (benchmarks/FileIOSink/dart/FileIOSink.dart):

 @before:

  FileIOSink.Add.ManySmall(RunTime): 2341597.0 us.
  FileIOSink.Add.OneLarge(RunTime): 111.06925927974774 us.
  FileIOSink.Add.AlternatingAddSize(RunTime): 105.65958788898234 us.

 @after

  FileIOSink.Add.ManySmall(RunTime): 5007.1125 us.
  FileIOSink.Add.OneLarge(RunTime): 98.23492468475541 us.
  FileIOSink.Add.AlternatingAddSize(RunTime): 91.77411527720551 us.

So the relative performance changes are:

 FileIOSink.Add.ManySmall(RunTime): 0.00213x (MUCH faster)
 FileIOSink.Add.OneLarge(RunTime): 0.884x (slight faster - noise?)
 FileIOSink.Add.AlternatingAddSize(RunTime): 0.868x (slightly faster - noise?)

https://golem.corp.goog/Revision?repository=dart&revision=102771&patch=17842

Change-Id: Ic73f33299a570096dd05f254982f556767559966
Bug:https://github.com/dart-lang/sdk/issues/32874
Tested: unit tests
CoreLibraryReviewExempt: Performance-only fix for file writes in the VM.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285420
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-03-13 22:39:13 +00:00
Johnni Winther 5e537e1cd2 [cfe] Integrate exhaustiveness checking into constant evaluator
This removes the use of [SwitchInfo], [SwitchCaseInfo] and
[ExhaustivessInfo] to pass on information for exhaustiveness checking
and instead uses the AST nodes directly in the constant evaluator.

Change-Id: Ie8d72b03e38334d1be9857794c38ed142dba5783
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288402
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-13 21:23:21 +00:00
Mayank Patke 64fbbfc1fa Update runtime_type_test to avoid .runtimeType on primitives.
Bug: https://github.com/dart-lang/language/issues/2895
Change-Id: I8ed01eee236e59a362f69430d8a3fd3650f35479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288320
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2023-03-13 20:08:53 +00:00
Ilya Yanok 936cdeeb2f Revert "Reland "Add more interface and final modifiers to dart:core.""
This reverts commit e293eb809d.

Reason for revert: Breaks G3.

Original change's description:
> Reland "Add more `interface` and `final` modifiers to `dart:core`."
>
> This is a reland of commit 4f8333e80e
>
> Blocked on Flutter patch: https://github.com/flutter/engine/pull/40175
>
> 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>
>
> CoreLibraryReviewExempt: Accepted in original CL.
> Change-Id: Id713edede4228801bb097a64734be4f2187f51a9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288206
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

Change-Id: I05ff2fe44e5a13f20725eb122963d20243062c7a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288503
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2023-03-13 16:08:31 +00:00
Lasse R.H. Nielsen e293eb809d Reland "Add more interface and final modifiers to dart:core."
This is a reland of commit 4f8333e80e

Blocked on Flutter patch: https://github.com/flutter/engine/pull/40175

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>

CoreLibraryReviewExempt: Accepted in original CL.
Change-Id: Id713edede4228801bb097a64734be4f2187f51a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/288206
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-13 15:21:30 +00:00