Commit Graph

42247 Commits

Author SHA1 Message Date
Danny Tuppeny 3d39175f5d [dds/dap] Improve display of errors calling toString() in debug views
Fixes https://github.com/Dart-Code/Dart-Code/issues/4400.

Change-Id: I46b36bcacdd0f8a33f296569fbc2e4ebece9d0f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284701
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-22 17:11:12 +00:00
Konstantin Shcheglov 67e7c96962 Fix parser to use correct begin token, to get documentation comments from it.
Change-Id: I9505353c9c6c00082e588aced34e8151c7ab22b7
Bug: https://github.com/dart-lang/sdk/issues/51447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284441
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-22 17:03:38 +00:00
Konstantin Shcheglov 5b55ed416f Update documentation for ByteStore.putGet(), update MemoryByteStore implementation
This brings it in sync with the existing implementation in Cider.

In Cider we cannot enfore no-putGet-when-data-exists because of possible
race condition, when data did not exist during `get` by isolate1, but
was put shortly after by isolate2, before isolate1 computed data and
attempted to `putGet`.

Change-Id: I36d9083f204be48e529e675a3f046784375f6fbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-22 17:03:09 +00:00
Paul Berry 8a4f638b07 Shared type analysis: stop tracking MatchContext.initializer
It turns out that some time ago I got rid of the logic that depends on
this; the associated functionality is still there, but it's tracked
automatically by flow analysis via
`_PatternContext._matchedValueInfo`, so we no longer need to track it
in the shared analysis logic.

Change-Id: Ia38e0baf5f599c929aa2000aade41473b997f80a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284480
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-02-22 16:41:59 +00:00
Kevin Moore fd836d3b34 vm_service: fix a bunch of comment references
also fix a couple of typos in service.md

TEST=re-ran generate script

Change-Id: I6fb6dbbc3780af14e5721817e20ec0e6370bfc1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284440
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-22 16:32:28 +00:00
Danny Tuppeny 658e34ee2a [analysis_server] Fix ordering of parameter+type InlayHints at the same position
Parameter name hints should always come before any other hints at the same position:

```
f(a: <int>[]);
  ^  ^^^^^
```

Change-Id: I8ae06c562e80df441fee9d3a8079c0048d01f903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284641
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-22 15:38:32 +00:00
Sam Rawlins 61e1808e2f [analyzer] Move 5 more HintCodes to be WarningCodes, SUBTYPE_*, UNDEFINED_*, UNNECESSARY_*
Bug: https://github.com/dart-lang/sdk/issues/50796
Change-Id: I7d15e27697093ecbdb958900f57e40d01753fdb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-02-22 15:24:39 +00:00
Ömer Sinan Ağacan b13f03dd4d [dart2wasm] Throw NoSuchMethodError in unimplemented external members
New passing tests:

- co19/Language/Functions/External_Functions/not_connected_to_a_body_t01
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A01_t03
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A02_t04
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A03_t03
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A03_t06
- co19/LanguageFeatures/Abstract-external-fields/static_analysis_external_A05_t03
- language/bool/has_environment_not_new_test
- language/constructor/external_constructor_test
- language/external_abstract_fields/external_fields_test
- lib/math/random_secure_unsupported_test

Change-Id: I74a430af37d3f138387a942ef028639224c312d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284622
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-22 13:35:34 +00:00
Ahmed Ashour 8ef5104d05 [cfe] create a Procedure
with a distinction between `inlineClassMember` and `extensionMember`.

Fixes #51338

Change-Id: I169c285537754137d5b32effc9697c2b9f4eb5c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283864
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-22 08:03:38 +00:00
Joshua Litt db076454e9 [js] Bump dependency after removing dependency on package:js.
Change-Id: Iecbdc301ed54dc25057c19b451c76ea8cf466983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283720
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-02-22 02:49:37 +00:00
pq b0078ad057 + RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA diagnostic
See: https://github.com/dart-lang/sdk/issues/51446

Change-Id: I4ebb0a8978bd98fc658737f69b790c2039c17d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-22 02:07:53 +00:00
Alexander Markov 143e4e9dc8 [vm/aot/tfa] Static weak references to method tearoffs
TEST=pkg/vm/testcases/transformations/type_flow/transformer/weak.dart
TEST=language/vm/static_weak_reference_test
TEST=language/vm/static_weak_reference_error_test

Bug: b/269223463
Change-Id: I23c8229c39217aa1c3f9fb576d8eefa5ceb1d8ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283421
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-02-22 01:01:29 +00:00
Keerti Parthasarathy b8db4a1272 Add a navigation test for patterns
Change-Id: I77094c1f58d7d3efa557607634acc393f0f6ff9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2023-02-21 23:59:02 +00:00
Nate Biggs 6548bf12ed [dart2js] Implement a bucketed work queue for the inferrer.
The bucket indexing can be made more complex but for now this simple change of processing CallSiteTypeInformations separately has shown an improvement in inference execution time (~5% on a big program).

Change-Id: If029906ca0c51d67939776732e0a25dcab7f6af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284400
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-02-21 23:25:23 +00:00
Nate Biggs 318f5b09c8 [dart2js] Merge diffs from inferrer/ into inferrer_experimental/
Change-Id: Iae08eaad674ec2aa0113cf832fdcdb1895c19024
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284040
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-21 23:25:23 +00:00
Nate Biggs 671b7e3c77 [dart2js] Fix handling of dynamic calls in linearized algorithm.
Change-Id: Ibeb285ee293fe522c4e32fedb91d3deee92f091a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284320
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-02-21 23:24:40 +00:00
Kallen Tu 1ce23bbd0b [cfe] Disallow subtyping Function with class modifiers enabled.
Fixes issue #51435

Change-Id: I7adaf190246f88dc3bd7a1e1e2f5dff231e03653
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283924
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-21 22:35:32 +00:00
Sam Rawlins e3c7b321a1 [analyzer] Trim 'Missing library' error text further
It looks like the error is currently truncated after the 100 root children and
approximately 170 reader URIs. Trimming to 50 root children and 50 reader URIs
seems quite safe. I can't claim that I foresee situations that could only be
solved by seeing the 50th URI, but I don't see any reason to pick a smaller
number.

Bug: b/267353400
Change-Id: I12ddcd7c89cfdc95faaef9feab56b6c22eee459f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284281
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2023-02-21 22:08:29 +00:00
Konstantin Shcheglov 479a98f5b5 Prepare to publish analyzer 5.6.0 and _fe_analyzer_shared 54.0.0
Change-Id: I6b36a25adfa78cb8d0534afa006daa66a6a8ed78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-21 21:26:42 +00:00
Stephen Adams 19ac93da32 [dart2js] Allow constant record Types to be named
Change-Id: Ib1ba362ea3f91329f2b2357597bc0e874a2c4d04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284280
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-21 20:01:50 +00:00
Kallen Tu 16b1c12619 [analyzer] Disallow classes to be used as mixins even inside the library.
Change-Id: I62aaf972a16cdd678f5711a41dc1652b89d0be37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283131
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-02-21 19:32:44 +00:00
Kallen Tu 57107ae59b [analysis_server] Add code completion for class modifiers at the beginning of a declaration.
Change-Id: I9dc1d80264d052c8f2ac75978e64280bd271f8d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-21 19:31:55 +00:00
Ömer Sinan Ağacan 004b400dfb [dart2wasm] Implement type parameter bound checks
New passing tests:

- language/generic_methods/bounds_test/02
- language/covariant/subtyping_test
- language/covariant/type_parameter_test
- language/records/simple/type_checks_test

Fixes #51358

Change-Id: I6854f71cbfc47106f685a00c36a64330cc0a57f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282660
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-02-21 18:56:16 +00:00
Devon Carew 2d15cad9e5 [pkg/dds] use package:lints/recommended.yaml
Change-Id: I05eb1af5dd985ee9f752b8ea409cabc785740472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283964
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-21 18:30:23 +00:00
Danny Tuppeny bc91549aea [analysis_server] Use the more specific "refactor.move" for Move Class to File
VS Code refactors based on kind and shows some well-known kinds in a specific order. One new group is "refactor.move".

It's not yet in the LSP spec/code-gen, so is added to our custom enum in the meantime.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4354.

Change-Id: I5577ef67a81667652258b873125dc491d96ce597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284144
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-21 17:27:27 +00:00
Derek Xu 41be8d54b5 [VM/Service] Make _getInstancesAsArray public
This CL updates the VM Service spec to v4.2 and adds the
`getInstancesAsList` service procedure.

This CL also adds `pkg/vm_service/test/get_instances_as_list_rpc_test.dart`
which was based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_test.dart`
and `pkg/vm_service/test/get_instances_as_list_rpc_expression_evaluation_on_internal_test.dart`
which was based on
`runtime/observatory/tests/service/get_instances_as_array_rpc_expression_evaluation_on_internal_test.dart`

TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/51393
Fixes https://github.com/dart-lang/sdk/issues/51003
Change-Id: I0faae80553ec397a1e89be0a714aab30e7854fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-02-21 17:26:52 +00:00
Danny Tuppeny e8a8e10bcd [analysis_server] Include Type inlay hints for inferred type arguments + literals
Fixes https://github.com/Dart-Code/Dart-Code/issues/4366.

Change-Id: I92b28869961a6098031a21ca1cf0d34f4decd16c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284143
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-21 17:07:25 +00:00
Konstantin Shcheglov a70386bfd6 Report CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE
Change-Id: I782bcf984e47162340baf96245dab8792fa3cbe0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-21 17:01:32 +00:00
Chloe Stefantsova 3f6636dfb4 [cfe] Adjust scope of pattern variables in collection if-elements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: I78a9f1cc2a5fdc483bb0c5a62c4260be7a5366ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284360
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-21 16:34:17 +00:00
Danny Tuppeny 43e26f18cc [dds/dap] Add support for showing inspect() variables in the debug console
This adds functionality that exists in the legacy VS Code DAP but was not reproduced here.

Calling `inspect(var)` (from `dart:developer`) would print the inspected variable to the Debug Console where the user can expand and review it (similar to using the Watch window).

Fixes https://github.com/Dart-Code/Dart-Code/issues/4330.

Change-Id: Ic63e6b6eb9f149dc8d80c4efdf622fb1c05bd580
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284183
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-21 15:57:28 +00:00
Danny Tuppeny 9356df41a0 [dds/dap] Ensure variable evaluateNames are stored for all lists/fields/getters
"evaluateNames" are returned to the client along with any variables, so the client can provide the user an expression that evaluates to that variable (used by "copy expression" or "add to watch".

DAP doesn't round-trip these as you expand variables, so we have to track them ourselves, but we were only doing so for map values. This fixes that to handle lists, getters, fields correctly too.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4352.

Change-Id: Id57e46a1cecf8bd22473911340b649ac05da65fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284223
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-21 15:56:58 +00:00
Jens Johansen 39b8f7bef4 [kernel] Shift up specialized kernel tags
Before this CL kernel tags had specialized tags that was marked by the
single high bit, then using the three lowest bits for a value:

128 + value = 0b10000xxx
136 + value = 0b10001xxx
144 + value = 0b10010xxx

So the numbers from 128 to 151 is taken by this scheme, but because of
the high bit marking stuff being special we can't really use 152-256.

This CL shifts the specialized tags up so it instead uses the 3 highest
bits as a marker while still using the lower 3 bits for the value:

224 + value = 0b11100xxx
232 + value = 0b11101xxx
240 + value = 0b11110xxx

This takes up 224-247 and leave 248-255 unused. It would let us use
128-223 though.
(If we eventually need more we can probably remove one of the
specialized ranges (SpecializedVariableSet isn't used very much in
previously sampled dill files) and use 4 bits for tagging).

Additionally, a tool to print free tags has been added (via binary.md),
and the "binary version is in sync with VM" test has been prepared
for version > 99.

TEST=Existing tests.

Change-Id: If77b12cee6fc3801628dd67dc40afbb018ec8a61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284302
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-02-21 15:21:38 +00:00
Ömer Sinan Ağacan 4d07dc0199 [dart2wasm] Fix overriding stack traces of re-thrown errors
New passing tests:

- language/stack_trace/rethrow_error_test/none
- language/stack_trace/rethrow_error_test/withtraceparameter

Change-Id: I446bce3a37846157d6b3e056e20a4b89ab03acf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284181
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-02-21 14:36:04 +00:00
Ömer Sinan Ağacan ff9fd9a2bd [dart2wasm] Fix representation types of classes
When computing representation of a class with implementers, use the
representation of implementers, rather than implementer classes.

New passing test: lib/math/implement_rectangle_test

Fixes #51406

Change-Id: I495353a00e3379e04123a77c270374b82c97a90a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284301
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-21 14:08:31 +00:00
Chloe Stefantsova 3ab2dfaaaa [cfe] Add support for c-style pattern-for elements in lists
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Iafc0239535dd89d0ff4bfa99bd10cdb3978b42ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284224
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-21 10:26:23 +00:00
Daco Harkes 40787d84fc [frontend_server] Add support for @Native assets
The VM can read native asset mappings from kernel.

Previous CLs already added support to embed native asset mappings for
one-shot compilation.
This CL adds support for adding native assets mappings to kernel files
created by the frontend_server with the incremental compiler.

The frontend_server accepts a `--native-assets=<uri>` at startup and
accepts a `native-assets <uri>` message on stdin as compilation
command.

The frontend_server caches the compiled native assets library.

When a `reset` command is sent to request a full dill from the
incremental compiler, the native assets mapping is taken from the
cache and added to the final dill file.

Split of DartSDK & flutter_tools prototype to land separately.

TEST=pkg/frontend_server/test/native_assets_test.dart

Bug: https://github.com/dart-lang/sdk/issues/49803
Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: I6e15f177564b8a962e81261815e951e7c9525513
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282101
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-02-21 07:29:29 +00:00
Jaime Wren abaf24e10d Avoid calling ByteStore.release() with an empty set
Change-Id: I5ca8b8acc5074d34dba3d01c0841f4c755634518
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283965
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
2023-02-20 19:59:36 +00:00
Ilya Yanok 029e0cec71 Revert "Enforce current library restrictions."
This reverts commit 0c05e33836.

Reason for revert: breaks ~10% of G3 smoke suite.

Original change's description:
> Enforce current library restrictions.
>
> Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
> Mark all current classes intended as mixins as `mixin class`.
>
> More additions and cleanup will follow,
> but this change should make everything keep working as today
> if we flip the switch.
>
> TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.
>
> Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Kallen Tu <kallentu@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ib0cb5b7ec1a8c392bbf9bf4af8dc3efc0b27991d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284187
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-02-20 15:29:41 +00:00
Chloe Stefantsova 459010fc3f [cfe] Ajust scoping for pattern variables in pattern-for statements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Ia5551f14b73b6ce50e8e7390f3b7995aaf5fda3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284140
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-02-20 15:02:26 +00:00
Martin Kustermann 354e8068a4 [kernel] Make package:kernel`s text printer end map constants with matching "}"
This makes it easier to navigate around in editors that can go to
matching braces/parenthesis (e.g. jump from end of constant section to
start).

TEST=Fixes kernel text printer & updates tests.

Change-Id: I6cbf34f5a62e11454e5de4d5fc9a313e0c6cf36c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283641
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-02-20 14:10:09 +00:00
Martin Kustermann 15ecb9b39f [gardening] Fix vm/cc/IsolateReload_{TypedefToNotTypeDef,NotTypedefToTypeDef} tests
With introduction to Dart 2.0 and Kernel as intermediate format, the VM
consumes kernel. The kernel is produced by CFE which lowers named
function type definitions to function types.

We therefore no longer have name classes between typedefs and classes
and the corresponding vm/cc/IsolateReload_* can be updated to no longer
expect an error.

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

TEST=Fixes vm/cc/IsolateReload_*Typedef* tests

Change-Id: Ic0697c5de03ef28e6cca104f5fbcb214e99d3fd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284182
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-02-20 13:54:29 +00:00
Ilya Yanok b74f4e1818 Count comparisons to null literal as a nullability signal
This breaks a good deal of tests and overall feels like preventing
a whole bunch of "make it non-nullable" stuff from working.

On the other hand, in cases where not the whole program is migrated
at once, and pieces of it keep being legacy and the whole thing
running in mixed mode, we would like to keep it on the conservative
side, so treat comparisons to `null` as a nullability signal.

I deleted some tests while updating others, I think a good deal of
updated tests probably should be deleted instead, but I kept them
for review, as these diffs show what exactly this change breaks.

Change-Id: I3d29dd446aefb7cfeb6219cffd9060ca8f57e50d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283681
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2023-02-20 12:58:37 +00:00
Martin Kustermann 789971863e [gardening] Fix pkg/vm/test/unlinked_ast_to_text_test & ensure it runs on bots
The pkg/vm/test/unlinked_ast_to_text_test test is run on bots like this

  tools/test.py -n unittest-asserts-release-linux \
        pkg/vm/test/unlinked_ast_to_text_test

This uses the dart binary from the just-built dart-sdk instead of normal
out/ReleaseX64/ folder. This led to the test return early without
testing anything.

Running locally `test.py` in other configurations on pkg shows that the
test is actually failing.

We fix the test and also ensure it runs on the only config that CI runs
(namely 'unittest-asserts-release-linux').

TEST=Fixes pkg/vm/test/unlinked_ast_to_text_test

Change-Id: If675e7ae1d9276f321234e0ce90d61724b64a5c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284180
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-02-20 11:28:58 +00:00
Ömer Sinan Ağacan cb9f1c5805 [kernel] Remove old TODOs
Change-Id: Ic3bd2fa65647b5f2ecca4001d725c6807cd23fa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284162
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-20 11:11:55 +00:00
Brian Wilkerson 392c2d6413 Add more tests for pattern variables
Change-Id: I44cab7deebf8e3be15890427055e833c00c5d322
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283963
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-02-20 01:23:28 +00:00
Johnni Winther 9bef75c6af [cfe] Call late setter in patterns lowering
Closes #51449

Change-Id: I91b34205768234bece460555bfcd781e38e61ffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-19 23:33:15 +00:00
Chloe Stefantsova 89639ba268 [cfe] Add support for set/map disambiguation for pattern elements
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Idb7f8e4bd1537abbe4133e69d2e51ae6b1e96a0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283862
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-19 21:07:36 +00:00
Lasse R.H. Nielsen 0c05e33836 Enforce current library restrictions.
Mark all currently unimplementable types as `final`, or `sealed` for `num` and `final` for `Function`.
Mark all current classes intended as mixins as `mixin class`.

More additions and cleanup will follow,
but this change should make everything keep working as today
if we flip the switch.

TEST= No new tests, very little actual change, covered by existing tests with few changes. Will add more tests when adding more modifiers.

Change-Id: I40e724f823e7f88cdef186d2f73874df256e2f43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281683
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
2023-02-18 12:37:40 +00:00
Ömer Ağacan 7c6423cb32 Revert "[kernel] Remove unused RecursiveVisitor type parameter"
This reverts commit a329e05684.

Reason for revert: Broke internal projects

Original change's description:
> [kernel] Remove unused RecursiveVisitor type parameter
>
> TEST=ci
>
> Change-Id: I523282e933b955389c950c1942253d2d66a51f3f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283821
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Ömer Ağacan <omersa@google.com>

TBR=johnniwinther@google.com,omersa@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Iad30e34ce0a491711b0daa1991c69de1796f8846
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284023
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-02-18 10:52:39 +00:00
Ömer Sinan Ağacan a329e05684 [kernel] Remove unused RecursiveVisitor type parameter
TEST=ci

Change-Id: I523282e933b955389c950c1942253d2d66a51f3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/283821
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-02-18 07:31:18 +00:00