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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Refuse to initialize VM if current Mac OS X version is below
MAC_OS_X_VERSION_MIN_REQUIRED, which was configured in build
time through mac_sdk_min GN argument.
TEST=tested manually by changing return value of MacOSXVersion
Cq-Include-Trybots: luci.dart.try:dart-sdk-mac-arm64-try
Bug: https://github.com/flutter/flutter/issues/121739
Change-Id: I9d913516077dbb196e8d6ebd7fe9f3914de7c748
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286932
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
- Update options for existing configurations.
- Add one new configuration for running _2 test suites.
- Rename builders and update to run new configurations.
Tested: Tested with led runs.
Change-Id: I87de456b6b2e53d9e211cbd716fef18910aba69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281348
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Improve discoverability on Github, etc
Change-Id: I675d06a1b3e8e38e3bc521840b3a0a4eef21291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287243
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Only the fields of a scrutinee type that are used in the cases are
now shown in the test expectations. When the field is not present,
for instance when the scrutinee type is nullable, or the fields are
only present on (some of) the subtype of the scrutinee type, the
fields are shown to be missing with a `-`.
Change-Id: I2d36b230e979dc929d083cfb8f9cdb9f1143d380
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This clears all of the implicit `Future<dynamic>` types in lib/.
Also a few `extends XyzVisitor<(implicit) dynamic>` are made into
`extends XyzVisitor<void>`.
Also a few raw Stream, StreamController, and Completer types.
Change-Id: I2471cc56d2d2d0545e5e103fff3189e745a54b49
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287245
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
With the parser code in the same library as the DOM classes, the
`pkg/analyzer/tool/messages/generate.dart` program, which generates all
of the diagnostic classes and diagnostics, _depends_ on a library
with a `parse` method which depends on these diagnostic classes (in
order to report errors while parsing HTML). This means that if
there is any existing error (like an unknown identifier) in the
existing error codes, it is impossible to generate the error codes.
Since we don't need the `parse` method to generate diagnostics, we
split up the library and remove the indirect dependency.
Separating the parser code out removes the loop.
Change-Id: Ifb9e9fd979e341ae64a1ed49aaf3758d3dcf1dee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
CoreLibraryReviewExempt: Minor change to the internal of a web backend specific API.
Change-Id: I450e9410af7e006b853e2d8f26dc5ede1d95f4e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245621
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Fixes: https://dart-review.googlesource.com/c/sdk/+/286860
Feedback welcome. I expect we'll want to iterate more on this but I see Erik's new content as a distinct improvement.
Change-Id: Iba385be6c411f2e5e3f1bd490b437dbea86e07aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286860
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
* 99% of these are `Future ` --> `Future<void> `
* There are some `test_` methods which declare a return type of `Future` which
is non-idiomatic, I think, but in order to create a pragmatic consistency, I
added `<void>` to the few test methods in these libraries. Later if we
desire, we can remove all of the return types.
* Also a few `Completer ` --> `Completer<void> ` and
`Stream ` --> `Stream<Object?> `
* There are many remaining cases in `lib/`
Change-Id: I41cd51bab6886788e15ac7065dd21e95e789d09f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Mutating the kernel AST can cause serialization and deserialization to
go out of sync when modular analysis is enabled, crashing dart2js.
Change-Id: If19afabacf1cb120a6804bd12ef268316de41f1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286862
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
This script has a decent description at the top, and decent comments
throughout.
Change-Id: I455c0e7b5354563750636e31a53db2caacdbf687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This chances the analyzer and CFE representation of constant values
to use the internal constant-to-text which doesn't include the
node type and in most cases resembles the source code corresponding
to the value.
For now, this is for creating less noise in the test. For the release
of the feature we need a more thorough handling since these texts
can be user facing when producing error messages.
Change-Id: I5b83d8b0c030e4ffb66422057acf5511619368e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287200
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>