Commit graph

90715 commits

Author SHA1 Message Date
Ryan Macnak 9e9b3770f4 [infra] Add configuration to migrate VM checked to NNBD.
Move from Linux to Mac because the Mac pool has more capacity.

Change-Id: Ie8beb33ea2f3e84f78a2824db5540249d6977e35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290608
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-03-23 17:45:27 +00:00
Kallen Tu 0fd1b672c5 [cfe/ffi] Don't ignore modifiers in dart:ffi when used in pre-feature code.
In pre-feature libraries, don't ignore the class modifier errors except for the base/final subtyping error. Otherwise, we can't even extend `base` types in older pre-feature versions.

Bug: #51683

Change-Id: I32ead106fc8d99a0dd72781368c41afefcfd8f53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-23 17:20:39 +00:00
Kallen Tu 69ce2b3104 [analyzer/ffi] Don't ignore modifiers in dart:ffi when used in pre-feature code.
In pre-feature libraries, don't ignore the class modifier errors except for the base/final subtyping error. Otherwise, we can't even extend `base` types in older pre-feature versions.

Bug:#51683

Change-Id: I884a9b8018899617444b9099bc64aef66bdb1eec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289081
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-03-23 17:11:33 +00:00
Chloe Stefantsova 6f6581ff75 [cfe] Implement TypeBuilderComputer.visitRecordType
Closes https://github.com/dart-lang/sdk/issues/51815

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

Change-Id: Ib01721765d6112e12d23cd5f8e2990b4c687d732
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290841
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-23 17:10:44 +00:00
Kevin Chisholm 072c817b5f [Process] Add template for breaking change requests
Breaking change requests are currently received in an unstructured way.  To create a more reliable and predictable process, we will use github forms.

This CL creates the form, follow-on CL will update the breaking change documentation.

Issue: https://github.com/dart-lang/sdk/issues/51801

Change-Id: I5ecaa042e3fafdd9d735dd43bccf954aa73e2a2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290605
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-23 16:48:46 +00:00
Johnni Winther 03700211b2 [_fe_analyzer_shared] Create pattern syntax for witnesses
This updates the toString on Witness to produce pattern code. The
created pattern is directly derived from the predicates of the
witness and there contain some needless precision, for instance
`[...[...]]` instead of `[...]`. It is the plan to address this in
a follow-up.

Change-Id: Ied7930f36b1e1818540b8c635b18ff92f28e113b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290720
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-23 16:25:41 +00:00
Joshua Litt 0d6a1acd75 [js] Flip strict mode flag for Dart2Wasm.
Change-Id: I1847e60d2db86dabeda78839895e1acacbe3ffc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290348
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-03-23 16:18:20 +00:00
Johnni Winther 31d32b2e24 [cfe] Ensure enablePrimitiveEquality is for the current library
This fixes a problem where current library of the constant evaluator hasn't be updated to match that of the transformer.

Change-Id: I3386747c20f8283f4a6789dbe33bc48a934d520f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290860
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-03-23 16:17:37 +00:00
Chloe Stefantsova cfe9932a9e [cfe] Make pattern matching error a StateError
This is the first step in adjusting the runtime error raised on a
pattern mismatch in an irrefutable context. For now, the error message
isn't specialized and doesn't reflect the nature of the mismatch.

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

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

Change-Id: Ie4b997a1a36e92b25f1372f4dd98941dbcc08b61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290842
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-03-23 16:10:16 +00:00
Srujan Gaddam 82a60e80d2 [dart2wasm] Refactor method specialization to use inheritance
We've been using enums to denote procedure types and lowerings, but
with object literals and invocation-level lowering, the code to
handle the enums become increasingly complex. This CL separates out
the logic to individual classes instead.

Change-Id: I896dcfe1a00d649bf19d8e5315ed1deca3c3dad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290606
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-03-23 16:09:34 +00:00
Konstantin Shcheglov 56a43c0867 Add 'DartType.isDartCoreType'
Change-Id: Ifd72be0e0e70e0d48f0f0ff8d2afa2102ef2d6ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290707
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-23 16:02:13 +00:00
Konstantin Shcheglov f2bd00a32a Rewrite expressions in ConstantPattern(s) into TypeLiteral when appropriate.
Bug: https://github.com/dart-lang/linter/issues/4195
Change-Id: I5cf06da31aed9347002684580c106747a057e1f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-23 16:01:31 +00:00
Danny Tuppeny 443d6d3200 [analysis_server] Don't produce inlay hints for parameters without names
Fixes https://github.com/Dart-Code/Dart-Code/issues/4436.

Change-Id: I15e144134e0e16f93ad38f2c393b32a7d18749ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290762
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-23 15:32:54 +00:00
Devon Carew 85cf783fe8 [pkg/test_runner] analyze with package:lints/recommended.yaml
Change-Id: Iab61ff9f67b40157657fde2d732e970d67c9fcac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290607
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-03-23 15:23:17 +00:00
pq db80d18ad4 support converting to switch expressions when cases have no breaks
Fixes: https://github.com/dart-lang/sdk/issues/51826

(Note: a pass to refactor some shared logic to follow.)

Change-Id: If82854f0d5fa5f6596308a04248bd6f4e7231a0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-03-23 14:58:34 +00:00
Sergey G. Grekhov 9640bef8ed [co19] Roll co19 to c1aef806ebbc20bedee6043bf517785f33fd1094
2023-03-23 sgrekhov22@gmail.com Roll failures fixed (dart-lang/co19#1962)
2023-03-23 sgrekhov22@gmail.com Fixes dart-lang/co19#1937. Add `@dart=2.19` to class implementing `LinkedHashSet` (dart-lang/co19#1961)
2023-03-23 sgrekhov22@gmail.com dart-lang/co19#1874. Update LanguageFeatures/nnbd/weak/overriding tests to work with class modifiers (dart-lang/co19#1960)
2023-03-22 paulberry@google.com Minor fixes to execution_pattern_for_in_{element,statement}_A01_t01 (dart-lang/co19#1958)
2023-03-22 sgrekhov22@gmail.com dart-lang/co19#1401. Tests for invocation keys (dart-lang/co19#1950)
2023-03-22 sgrekhov22@gmail.com Fixes dart-lang/co19#1951. Don't use fixed port number (dart-lang/co19#1952)
2023-03-22 sgrekhov22@gmail.com Fixes dart-lang/co19#1955. Use non-matching rest elements in matching_list_A02_t01.dart (dart-lang/co19#1957)
2023-03-22 sgrekhov22@gmail.com Fixes dart-lang/co19#1940. Add `final` modifier to classes extending `Struct` and `Union` (dart-lang/co19#1956)
2023-03-21 sgrekhov22@gmail.com Fixes dart-lang/co19#1928. Replace `extends Iterator` by `implements Iterator` (dart-lang/co19#1953)
2023-03-21 sgrekhov22@gmail.com Fixes dart-lang/co19#1944. Replace `extends StreamSubscription` by `implements StreamSubscription` (dart-lang/co19#1954)
2023-03-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1946. Duplicated test removed (dart-lang/co19#1948)
2023-03-20 sgrekhov22@gmail.com Fixes dart-lang/co19#1947. Move nnbd-strong runtime checks in a separate test (dart-lang/co19#1949)
2023-03-20 sgrekhov22@gmail.com dart-lang/co19#1401. Matching tests for map pattern (dart-lang/co19#1929)
2023-03-17 sgrekhov22@gmail.com dart-lang/co19#1401. Call insertions tests added (dart-lang/co19#1945)

Change-Id: I27c375f32b02e8bea78562adb58ef5da1b629a45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290764
Reviewed-by: Alexander Thomas <athom@google.com>
2023-03-23 14:22:47 +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
Johnni Winther f7058a2301 [cfe] Add test for 51716
Closes #51716

Change-Id: I4d5e17af7be3cacd3ca9b4c2301de798a1ea00bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290530
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-03-23 08:25:09 +00:00
Joshua Litt 2459634762 [js] Bump package:js min version.
This is due to bd79be0e19, which will break users on older versions of the SDK.

Bug: #51774
Change-Id: I44f3bd5d0e4bc889d393440b03b4bab33d2ca70a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289620
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-03-23 04:03:10 +00:00
Sam Rawlins f8c6f2135d [analyzer] Remove many instances of the word 'hint'
I took care to leave code and comments which _does still_ refer to the
remaining Hints. This CL is not super complete, but I think addresses
most of the outdated text refering to Hints. I will do another round
after migrating more to Warnings.

Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: Iab58dbbfbdef86e21dd65b2a96d8e34e3e7e54ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-03-23 03:59:55 +00:00
Sam Rawlins be7d6f6b2b Report UNNECESSARY_NAN_COMPARISON_FALSE when nan used in constant pattern
Bug: https://github.com/dart-lang/sdk/issues/51750
Change-Id: Ia7949ebcc5dc3b736cbd0321527a132f2303b164
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-03-23 03:55:08 +00:00
Nate Biggs 5ac0a50d43 [dart2js] Fix work queue bucketing.
I'm reverting the work queue change for the main inferrer branch. After some instrumenting I've found that it's rather sensitive to the max refinement limit which is very low for the non-experimental branch. In the linearized algorithm the refinement limit is increased so I will keep it in that fork.

Change-Id: I3407ae4d895c9910b6588dea5782ba4b6208ec7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290420
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-23 03:18:57 +00:00
Sigmund Cherem f72782ce9b [dart2js]: require dart2js to be invoked from an approved CLI
The dart2js snapshot is not meant to be invoked directly except from
a limited set of entry points (CLIs and internal build systems).
This change makes it an error to invoke it in unsupported ways.

Note: this change is not expected to be visible to end users.

Fixes #51695

Change-Id: I4013dd00b90bb3d54483e2f112e0ddfb8dc694e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289885
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-03-23 01:58:58 +00:00
Srujan Gaddam 9231c6182c [dart:html] Remove duplicate switch case
Fixes https://github.com/dart-lang/sdk/issues/51754

META and WIN_KEY_LEFT have the same value. The switch case for the
second value is never triggered, so we should remove it.

CoreLibraryReviewExempt: No functional change, just silencing warnings.
Change-Id: I51afe53a3d41e2c2fa820c2bb16e1bdea4583fac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290702
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-03-23 00:57:57 +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
Liam Appelbe 929fec660b Reland "[vm] Refactor StubCodeCompiler to be a real class."
This is a reland of commit afdf640866

Original change's description:
> [vm] Refactor StubCodeCompiler to be a real class.
>
> Previously, StubCodeCompiler was just a set of static methods, all of
> which take an assembler as their first arg. This makes it hard to pass
> additional state to the ~160 stub macro defined stub generators.
>
> This refactor makes StubCodeCompiler a real class, with assembler as a
> field. So we can easily add new fields to the class later, to pass new
> state without having to update every stub generator.
>
> assembler is declared as a public field for a few reasons:
> - There's one place where it needs to be accessed by a non-member
>   function (in the ia32 file).
> - If it's private, it has to be named assembler_, which would mean a lot
>   more insignificant diffs.
> - Non-member functions that take assembler would have to take assembler_,
>   for consistency with the __ macro, which would be weird.
>
> Change-Id: I142f0803a07c7839753188065c69c334d4d1798a
> TEST=CI
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289924
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

Change-Id: Ib5be28c46a0a80b84e31aea60893ab5bbc02e2ea
TEST=CI, including all sanitizers and architectures
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290681
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2023-03-22 23:48:56 +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
Nate Biggs 199ac35f8e [dart2js] Save memory by computing calledOnce at the end of inference.
Today we track and constantly update maps of distinct callers throughout the inference algorithm. Instead we can simply iterate over all call sites and set the `isCalledOnce` flag after all call targets have settled. This result is not used in inference, it is just saved out to the results for the member so the timing doesn't matter.

On a large program this shows a ~4% memory improvement and marginal runtime improvements (in addition to 4% from https://dart-review.git.corp.google.com/c/sdk/+/290060/6).

Change-Id: I403a5cfeba0d5c0175f40626d39ac05860769961
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290120
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-03-22 21:11:50 +00:00
Nate Biggs dfe33d307b [dart2js] Save space on TypeInformations by using a bit mask for all flags.
Saves ~4% memory while compiling a large program with no apparent impact to runtime.

Change-Id: Ibc17041cba992b35f0ff6f76d0d422d968576c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290060
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-03-22 21:11:50 +00:00
pq dfe1093849 meta 1.9.1
Fixes: https://github.com/dart-lang/sdk/issues/51059

Change-Id: I7f28741ad0d1507cc1140da6c7c0bccb31d6946b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290604
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-03-22 20:58:58 +00:00
Ben Konyi 27171f2d73 [ CLI ] Print unnecessary experiment warning to stderr instead of stdout
Fixes https://github.com/dart-lang/sdk/issues/51820

TEST=pkg/dartdev/test/commands/analyze_test.dart

Change-Id: I6c3f31806e466b594776aa93062addc1ced4dc20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290621
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-22 20:55:36 +00:00
Nicholas Shahan b4442e92eb [dart2js] Compile modular tests with null safety
The .dill and .js compilation steps in the modular suites now use
sound null safety for the files under test.

Change-Id: I264c39d70d160377b4581f910cff1a611819cfbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289405
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-03-22 20:09:33 +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
Konstantin Shcheglov 8e055884c5 Add a couple more tests for isPotentiallyMutatedInScope()
Change-Id: I866f0039228dc9ada53e0c88585ac7f947c28a80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290610
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-03-22 19:53:44 +00:00
Stephen Adams cbe7075b7a [js_runtime] Safe-print records in Error messages
The js_runtime implementation of `Error.safeToString` now understands
Records.

`ArgumentError.value((1, 2))` now prints as

    Invalid argument: Record (1, 2)

instead of the old way:

    Invalid argument: Instance of '_Record_2'

I don't think `Record` is necessary, but this is consistent with the
VM error messages.

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

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

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

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

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

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

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

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

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

Fixes #51802

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

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

TEST=N/A

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

Commented out deprecation for now.

Original change's description:
> Add class modifiers to `dart:convert`.
>
> The usual approach:
> Pure interfaces marked `interface`.
> Pure implementation classes marked `final`.
> Base classes marked `base` or nothing, and `mixin class` if reasonable.
> Combined X/XBase/XMixin where possible.
>
> CoreLibraryReviewExempt: Aske is away
> Change-Id: I927f9bd488fb385ff9c17c8fc94920a1f5076347
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289200
> Reviewed-by: Stephen Adams <sra@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>

CoreLibraryReviewExempt: Approved in original.
Change-Id: I1bc14f99b742567e2634dcfcbc52f332dbcc5364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290521
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-03-22 15:34:38 +00:00