Commit graph

99911 commits

Author SHA1 Message Date
Keerti Parthasarathy 249895f979 Add type hierarchy tests for augmentations for LSP protocol.
Change-Id: Ie6358f4908e988b89afea44b663d03c042346e1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353204
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-21 01:04:03 +00:00
Mayank Patke 69df740ea9 [dart2js] Assorted TODO cleanup, bump pubspecs to 3.3.0
Change-Id: I621ac252c5d6f3b157a2f194b7f0b7ad85874e4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352990
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-02-21 00:02:13 +00:00
Srujan Gaddam e9678f72de [dart2js] Handle object literal constructors with no library @JS annotation
Fixes https://github.com/dart-lang/sdk/issues/54801

Object literal constructors need to be explicitly handled when
determining a member is JS interop or not in dart2js as it does
not require any @JS annotations.

Change-Id: Iee99375439057844485aa3f5cd88f85f5d03ae06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349840
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-02-20 23:59:24 +00:00
Vyacheslav Egorov 9fe6571a75 [vm/compiler] Let Parameter carry its location
Previously we would specify parameter offset and base register and
use SpecialParameter instruction to represent values passed in
registers.

This CL simplifies and merges these concepts: now every Parameter
instruction simply carries around its Location.

This CL also tweaks printing of stack slot locations so that they
are easier to read: `S+1` becomes `fp[1]` or `sp[1]` depending on the
base register, DS+1 becomes `dword fp[1]` / `dword sp[1]` and `QS+1`
expands to `qword fp[1]`/`qword sp[1]`.

Additionally we clean `BlockBuilder` API a bit - instead of
passing `with_frame` to `AddParameter` we make this the
property of the builder itself, set at construction time.

Issue https://github.com/dart-lang/sdk/issues/54955
Closes https://github.com/dart-lang/sdk/issues/31956

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-release-arm64-try,vm-aot-linux-release-simarm_x64-try,vm-ffi-qemu-linux-release-arm-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-linux-product-x64-try,vm-aot-mac-release-x64-try
Change-Id: Ie24dc6b6c47b3a45db722813218bc53c3a06c91d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353081
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-20 23:54:08 +00:00
asiva ac39be3eed [VM/Service] Define vmservice entry points only under non product mode
TEST=ci

Change-Id: I2d72d4c786e3725434c552a317da6b50a08646c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353228
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-20 22:48:47 +00:00
Mayank Patke 0d9d7f4e75 Clean up TODOs in TryConstantEvaluator.
Issue: #48820
Change-Id: I01a9c7b1de3697afc2d643a5a1c7aaa26532ea70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352974
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-20 21:46:43 +00:00
Mayank Patke 2fc877a09a [dart2js] Use new method encoding in runtime type analysis.
Change-Id: I41e6b6314266203e37badcb084becd95894bdf6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352966
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-20 21:42:19 +00:00
pq 3f5a96bbf4 don't overreport prefer_void_to_null in augmentations
See: https://github.com/dart-lang/linter/issues/4890

Change-Id: Ie2f3364e781c5b62cbea252460b28ba48482a552
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353203
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-20 21:01:50 +00:00
Mayank Patke b0a96bf950 [dart2js] Clean up handling of missing super methods.
Issue: #47406
Issue: #48820
Change-Id: I19de399c4670f9866cffceae3bc3ce19201d1ed3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352963
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-02-20 21:01:14 +00:00
Devon Carew 3722837cec Bump http to 6d9f9efe04886d9685fbfb1a76ba24a71b6c951c
Changes:
```
> git log --format="%C(auto) %h %s" f0a02f9..6d9f9ef
 https://dart.googlesource.com/http.git/+/6d9f9ef blast repo changes: auto-publish, github-actions, no-response (1133)
 https://dart.googlesource.com/http.git/+/d8b237d [http] Migrate to the latest pkg:web, require Dart 3.3 (1132)
 https://dart.googlesource.com/http.git/+/5179d1c Bump actions/cache from 3.3.2 to 4.0.0 (1125)
 https://dart.googlesource.com/http.git/+/0b803e8 Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (1124)
 https://dart.googlesource.com/http.git/+/82e0424 Use preferred flutter version constraints (1119)
 https://dart.googlesource.com/http.git/+/ccefa7c Support `BaseResponseWithUrl` in `package:cupertino_http` and `package:cronet_http` (1110)
 https://dart.googlesource.com/http.git/+/e7a8e25 Add `BaseResponseWithUrl.url` (1109)
 https://dart.googlesource.com/http.git/+/c8f17a6 Add a contributing guide (1115)
 https://dart.googlesource.com/http.git/+/ebd86b9 Add the ability to get response headers as a `Map<String, List<String>>` (1114)
 https://dart.googlesource.com/http.git/+/5c75da6 Add tests for sending "cookie" and receiving "set-cookie" headers (1113)
 https://dart.googlesource.com/http.git/+/c2a6d64 [cronet_http] ⬇️ Downgrade `minSdkVersion` to 21 (1104)
 https://dart.googlesource.com/http.git/+/661f5d6 Use `package:http_image_provider` in all `Client` implementation examples (1089)
 https://dart.googlesource.com/http.git/+/473a892 Remove the "play-services-cronet" dependency in the example app when building `package:cronet_http_embedded` (1103)
 https://dart.googlesource.com/http.git/+/e79ebe1 Fix `labeler.yml` (1099)
 https://dart.googlesource.com/http.git/+/73b0b1c Bump actions/labeler from 4.3.0 to 5.0.0 (1096)
 https://dart.googlesource.com/http.git/+/15ec3ba Prepare to publish `package:cronet_http` as 1.0.0 (1087)
 https://dart.googlesource.com/http.git/+/26e55c3 cronet_http: require android API level 28 (1088)
 https://dart.googlesource.com/http.git/+/b10f448 [cronet_http] Enables CI for `cronet_http_embedded` (1070)
 https://dart.googlesource.com/http.git/+/a5b8eec Prepare to publish cupertino 1.2.0 (1080)
 https://dart.googlesource.com/http.git/+/c114aa0 Add a fake response for PNG images (1081)
 https://dart.googlesource.com/http.git/+/db2cb76 Run web tests with wasm with dev Dart sdk (1078)
 https://dart.googlesource.com/http.git/+/36f98e9 Fix a bug where BrowserClient was listed as requiring Flutter (1077)
 https://dart.googlesource.com/http.git/+/db7f165 Provide an example of configuring IOClient with an HttpClient. (1074)
 https://dart.googlesource.com/http.git/+/cd748b6 Document that runWithClient must be called for every isolate (1069)
 https://dart.googlesource.com/http.git/+/f585947 Test persistentConnection with large request bodies (984)
 https://dart.googlesource.com/http.git/+/7c05dde Add documentation for "no_default_http_client" (1068)
 https://dart.googlesource.com/http.git/+/d8983fa Add support for setting headers for all requests (1060)
 https://dart.googlesource.com/http.git/+/c90496e Document how to use replacement `Client` implementations (1063)
 https://dart.googlesource.com/http.git/+/c8536e4 [http_client_conformance_tests] Updates to support wasm compilation (1064)
 https://dart.googlesource.com/http.git/+/5dd5140 Bump actions/setup-java from 3 to 4 (1065)
 https://dart.googlesource.com/http.git/+/064f510 misc cleanup of yaml files (1061)
 https://dart.googlesource.com/http.git/+/22f52e2 Update pubspec.yaml to 0.4.2 (1059)
 https://dart.googlesource.com/http.git/+/40a46d8 Fix a bug where cronet_http sends incorrect HTTP request methods (1058)
 https://dart.googlesource.com/http.git/+/c125ed5 [http] Allow pkg:web v0.3.0 (1055)
 https://dart.googlesource.com/http.git/+/9fb4cfa Update lints to latest, etc (1048)
 https://dart.googlesource.com/http.git/+/5e84d9f Update platform-specific imports for wasm (1051)
 https://dart.googlesource.com/http.git/+/8c9feb5 [http] Fix type cast for dart2wasm (1050)
 https://dart.googlesource.com/http.git/+/a2f0b25 [http] use pkg:web, require Dart 3.2 (1049)

```

Diff: https://dart.googlesource.com/http.git/+/f0a02f98f7c921e86ecc81c70f38bb6fbccc81b9..6d9f9efe04886d9685fbfb1a76ba24a71b6c951c/
Change-Id: Ic67698b3c808f4fc550cd3c59dc8efdf508384df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353202
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-02-20 20:53:18 +00:00
Paul Berry 32ab547688 Fix analyzer handling of record literal type inference.
This CL contains several small bug fixes:

- The context is only used for type inference if it is a record type
  with the same shape as the record literal. Previously, if the
  context was a record type with a different shape than the record
  literal, the analyzer would attempt to do an approximate match
  (using the context from any matching named fields, and from all the
  positional fields that were in common between the context and the
  literal). At first glance, it might seem like this would only matter
  for erroneous code (since record shape mismatches typically lead to
  compile-time errors). But if the context arises from a local
  variable promotion, then a mismatch doesn't lead to a compile-time
  error; it simply leads to a demotion. So the difference is
  observable for non-erroneous code.

- If one of the fields is implicitly downcast from `dynamic`, the
  static type of the field's expression remains `dynamic`. This makes
  the behavior of dynamic downcasts inside field literals consistent
  with all other implicit dynamic downcasts.

- If one of the fields is implicitly downcast from `dynamic`, the
  downcast is made to the greatest closure of the context. Previously,
  the downcast was made to the context itself, which meant that it was
  possible to create static types containing the unknown type,
  violating one of the key assumptions of the Dart type system.

- If one of the fields has a static type of `dynamic`, and `dynamic`
  is a subtype of the greatest closure of the context (e.g. because
  the context is `Object?`), no dynamic downcast is
  performed. Previously, a dynamic downcast _was_ performed, meaning
  that the static type of the resulting record literal would have
  `dynamic` in a spot where `Object?` should be.

This brings the analyzer behavior into line with the spec and the
front end, with one minor exception:

- When the front end uses the greatest closure of the context to
  implicitly downcast a field from dynamic, it uses a modified
  greatest closure algorithm where covariant instances of `_` are
  replaced with `dynamic` instead of `Object?`.

The front end's behavior in this rare case doesn't agree with the
spec; I'll address this in a future CL.

Change-Id: Ib1ab7ee4d0f63a152480704e2c0d5332446a613c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350983
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-20 20:21:48 +00:00
Ryan Macnak cfe4462b28 [vm] Add some warnings to Dart_RecordTimelineEvent.
TEST=no
Change-Id: I448901c2767c48e931dc492e000d2f01e5194ed8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353225
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-02-20 20:18:09 +00:00
Dan Chevalier 952e3b718f Add --unrestricted to DTD command.
NOTE: the tests view better if you turn off whitespaces on the diff.

This command will start a DTD instance that has the FileSystem service restrictions disabled. Which can be used in development environments.

Bug: https://github.com/dart-lang/sdk/issues/54762
Change-Id: I829f83d7c7afc7dd83732fc8a600cb41ffe36f63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352921
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-02-20 20:08:57 +00:00
Danny Tuppeny 30b9238561 [dds/dap] Increase number of toStrings() per evaluation from 11 to 100
This was an apparently error when moving to the SDK DAPs. The original DAPs performed 100 toStrings() (and 100 is the batch size for VS Code, so the user wouldn't usually see the limit) but we'd done 10 (actually 11) here.

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

Change-Id: Ie3ca74c9189a725adb971646db2defaf1ffa9627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353104
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-20 19:24:12 +00:00
asiva 6ee5474a62 [dartdev/tests] Fix racy tests.
Fix vm service tests which are racy as dds is spawned as an external
process and the testee process might have exited before dds
connects to it.

Change-Id: I514e20c84c6041cb1b65854494698911a34eb50e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352464
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-02-20 19:14:44 +00:00
Sam Rawlins 6ff4673225 build_integration: prepare for stricter implementation_imports check
As an oversight, this lint rule doesn't currently check non-lib directories. It
will in https://dart-review.googlesource.com/c/sdk/+/351160.

Change-Id: I6881a2224a2f3689e84bba36b331184fef497239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353223
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-02-20 18:47:41 +00:00
Derek Xu 391c0fb6c0 [VM] Remove deprecated Dart_TimelineEvent embedder API
TEST=CI

Change-Id: I094c32ec44a886a8154692de22b6575661918d29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353240
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-02-20 18:18:30 +00:00
Paul Berry 8047862840 Change a HACK to a TODO
The analyzer team has decided to adopt the convention of using `TODO`
comments to document long term issues that should persist in the
codebase, and `FIXME` comments to document short term issues that need
immediate attention (see
https://dart-review.googlesource.com/c/sdk/+/295662).  They may even
consider adding a presubmit hook to ensure that `FIXME` comments are
only used during local development.

We didn't consider `HACK` comments at the time, but IMHO it makes
sense to treat them the same as `FIXME` comments; that is, as a rule
we don't include them in checked in code.

This change restores the analysis server to a state of having a clean
"problems" view when edited using Visual Studio code.

Change-Id: Icd6079cb1eb47e02d9084332d0bad0e3afa04177
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-02-20 18:15:11 +00:00
Sam Rawlins 35075c1c22 modular_test: prepare for curly_braces lint change
This aligns this code better with Effective Dart and prepares for the
upcoming lint rule change at https://dart-review.googlesource.com/c/sdk/+/353140.

Change-Id: Ibfb4736ae01a6e2d843f9faf19eba08c16ff6c92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353222
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-02-20 17:56:29 +00:00
pq 22520f43f9 mixin support for camel_case_types
Fixes: https://github.com/dart-lang/linter/issues/2532

Change-Id: Icbc5c9ae4bd8b50c1a4471424bd9ae3d95299257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352976
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-20 16:59:03 +00:00
pq c55a99c855 non_constant_identifier_names support for augmentations
See: https://github.com/dart-lang/linter/issues/4883

Change-Id: Ia83e8a6e8e726bc3ef83ccbc5c0106f9698e4d4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352978
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-20 16:57:54 +00:00
osaxma a3cb1f6bdc Fix issue where invalid analysis options file is produced for some tests
R=brianwilkerson@google.com

fixes: https://github.com/dart-lang/sdk/issues/54921
Change-Id: Ib1d7fa2400ea587ff66568efdaec67559cad1e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352866
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Osama Alraddadi <osama.alraddadi@gmail.com>
2024-02-20 16:51:00 +00:00
Erik Ernst bf17088787 Add test about types being incompatible with await
PR https://github.com/dart-lang/language/pull/3560 and
https://github.com/dart-lang/language/pull/3598 updated the feature
specification of extension types to define a notion of types being
'incompatible with await'. This CL adds a test to verify that various
types are being classified correctly, and errors are hence reported
as expected for expressions of the form `await e`.

Change-Id: I39e992b4317ef49fbc2267819481d71d87b56aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351143
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-02-20 16:49:49 +00:00
Sam Rawlins e61f2a0d89 dart2wasm: prepare for curly_braces lint change
This aligns this code better with Effective Dart and prepares for the
upcoming lint rule change at https://dart-review.googlesource.com/c/sdk/+/353140.

Change-Id: I96e77d5c49c17fe0dfcbef7e997cb9d634f1e648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353201
Reviewed-by: Ömer Ağacan <omersa@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-02-20 16:35:28 +00:00
Sam Rawlins cda9755918 dev_compiler: prepare for curly_braces lint change
This aligns this code better with Effective Dart and prepares for the
upcoming lint rule change at https://dart-review.googlesource.com/c/sdk/+/353140.

Change-Id: I1b3ff4a4f85ec2182d06a67acf0e43fbc45129f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353220
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-02-20 16:04:30 +00:00
David Morgan 93b7791c0c [macros] Fix flakiness on Windows related to add during flush and timeouts.
R=jakemac@google.com

Change-Id: I48f5829613ca2999caf23a485648054b920596a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352907
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-02-20 15:47:10 +00:00
Brian Wilkerson e1f1151870 Suggest pattern variables declared in a for loop
Fixes: https://github.com/dart-lang/sdk/issues/52851
Change-Id: Ie44af3d9a336ba6daa26b52abcf29bada88bf660
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352998
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-20 15:44:22 +00:00
Martin Kustermann c4fbfc9271 [vm] Make iso-stress builder use valid -Dtest_configuration when compiling the giant stress test
Some tests that are run as part of the giant iso-stress test are relying
on `package:expect/config.config` getters, which in return rely on the
test configuration being set as part of the compilation from the app

=> We pass valid JIT & AOT configurations when compiling the giant iso
   stress test files.

TEST=May fix the iso-stress failures.

Change-Id: Icacbfe941eb01030c010670f35848a76c9a8ee12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353102
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-02-20 09:39:00 +00:00
David Morgan 980cf725ff [test] Check all local files for error strings.
Based on abandoned change #264261.

Changes to that PR: compare and show file paths, improve part parsing, include analyzer expectations from other files as well as CFE expectations, update unit tests.

Add end to end tests. The simplest case "library_failure_test.dart" passes before this PR, all others require the change in this PR to pick up expectations in other files.
Change-Id: Ia71b78a8f0dced83f603309877132f261b47c5a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345541
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
2024-02-20 09:31:21 +00:00
Alexander Markov c1f5305f49 [vm/compiler] Eliminate unused allocations
Unused object, closure, context and record allocations can be always
eliminated, even when allocation sinking is disabled due to a
'try' block.

TearOff.Inlined.InTry benchmark +534-1481%

TEST=runtime/tests/vm/dart/eliminate_allocations_il_test.dart
Issue: https://github.com/dart-lang/sdk/issues/54808
Change-Id: I5a4094b391079fd0d63af48bec4594179806fdf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350341
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2024-02-20 09:30:56 +00:00
Chloe Stefantsova aa043e90a4 Revert "[analyzer][cfe] Expand TypeAnalyzerOperations. Part 1"
This reverts commit a8cf0a0825.

Reason for revert: The CL broke a few places in google3.

Original change's description:
> [analyzer][cfe] Expand TypeAnalyzerOperations. Part 1
>
> This CL adds more of the type operations required in the subtype
> constraint gathering algorithm into the shared type operation
> class. The added operations are used in the constraint gathering
> algorithms in the Analyzer and the CFE.
>
> Part of https://github.com/dart-lang/sdk/issues/54902
>
> Change-Id: Ia895fc84bd7ab666330a4ab32b6e759f0977e750
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346840
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>

Change-Id: Ibf75bb6dda4a4f5f36a2265036703977b28a4333
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353160
Auto-Submit: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-02-20 09:14:00 +00:00
David Morgan 859e359266 [macros] Cleanup after exception changes.
Add `RequestChannelException`, remove unused `RemoteExcepion`, update
some doc comments.

R=jakemac@google.com

Change-Id: Id51d2a9d16e7d4599703470b5c974c2bd438c55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352911
Auto-Submit: Morgan :) <davidmorgan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-02-20 09:07:29 +00:00
Jens Johansen b25ebda686 [macro] Add 'isClosed' to ExternalMacroExecutorBase and throw if using it after
E.g. running
```
out/ReleaseX64/dart pkg/_fe_analyzer_shared/test/macros/executor/executor_test.dart
```

(which is apparently the wrong executable) fails after 12 minutes (!)
with "TimeoutException after 0:12:00.000000: Test timed out after 12
minutes."

With this instead it runs in a few seconds because the stuff that makes
it wait forever throws instead.

Change-Id: Idd8be08438863511769b4cace1a492d613cadb03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352301
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-02-20 08:19:18 +00:00
Sam Rawlins 4c30a89904 analyzer: Correct the scope in a switch statement case
Fixes https://github.com/dart-lang/linter/issues/4457

In the previous code, we set a Scope on the SwitchStatement for the
first `memberGroup`, and then _overwrite_ that Scope for each
subsequent `memberGroup`. This manifests in
`ScopeResolverVisitor.getNodeNameScope` using a scope from one switch
member that does not know about the variables declared in the relevant
switch member.

Change-Id: Ic88a800db339712b83a66d4d647b20005b2b8305
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-20 00:37:43 +00:00
Johnni Winther a765ffc540 [cfe] Generate merged augmentation library for macros
This adds support for generating the merged augmentation library in the
CFE. In order to get the right file offsets in the generated AST the
MacroExecutor.buildArgumentationLibrary function is extended to compute
a list of spans the describe what each segment of the generated source
code contains. These spans are used to compute the offset relation
between the intermediate augmentation libraries and the merged
augmentation libraries.

Change-Id: Ie5b9c23130da67ac874fb824b82827bfd6b88880
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349864
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-02-19 12:35:22 +00:00
Johnni Winther c4724e5a89 [cfe] Add Throw.forErrorHandling
This adds a `forErrorHandling` to the `Throw` node. This is used that the `throw` is *not* present in the source code but added to ensure
correctness and/or soundness of the generated code.

This is used for instance in the lowering for handling duplicate writes
to a late final field or for pattern assignments that don't match.

In response to https://github.com/dart-lang/sdk/issues/53519

TEST=updated ast-to-text

Change-Id: Ie103829d98fda9cd7b64e9e3d893e77d1e86d7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347900
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2024-02-19 12:12:02 +00:00
Chloe Stefantsova a8cf0a0825 [analyzer][cfe] Expand TypeAnalyzerOperations. Part 1
This CL adds more of the type operations required in the subtype
constraint gathering algorithm into the shared type operation
class. The added operations are used in the constraint gathering
algorithms in the Analyzer and the CFE.

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

Change-Id: Ia895fc84bd7ab666330a4ab32b6e759f0977e750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-02-19 10:41:00 +00:00
Chloe Stefantsova 59eb20c04d Test collecting constraints in extension type vs non-extension types
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: I142b57ddddba4e701a1c39af0e90f98f573635be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352861
Reviewed-by: Paul Berry <paulberry@google.com>
2024-02-19 10:41:00 +00:00
Daco Harkes dabad3bb30 [gardening] Mark test as slow
The test runs multiple test cases in sequence.

Bug: https://github.com/dart-lang/sdk/issues/54950
Change-Id: Id57771c2456ad18d14c7b6112a5cd2764336df01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352909
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-02-19 10:21:38 +00:00
Elias Yishak 53cbcc8c81 Revert "Add parameter for analytics instance"
This reverts commit 0e5542211c.

Reason for revert: breaking google3 tests

Original change's description:
> Add parameter for analytics instance
>
> R=sstrickl@google.com
>
> Change-Id: I8ef2fe2c757a7625c2e3aa7eba48513e4c2f4e88
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352561
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
> Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>

Change-Id: Iec1f2eb0224e8ff8b0375736a96f3986c42cacaa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353040
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Elias Yishak <eliasyishak@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-02-19 08:58:28 +00:00
Johnni Winther 6e4674d445 [kerne] Remove type parameter from RecursiveVisitor
The type parameter was a left-over from a pre-nnbd encoding of the visitors, but Flutter dependency on the code prevented its removal.

TEST=existing

Change-Id: I02657a469290f169077faa1167cf59b75de13c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350840
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-02-19 07:51:43 +00:00
Brian Wilkerson 1af1f2ea8d Copy lookup methods from InterfaceElement to Augmented classes
Change-Id: Ie93e6aee9dc0f7a918d694303b0f640296e2df42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352971
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-17 01:15:37 +00:00
Konstantin Shcheglov 8fe47542f5 Macro. Provide 'macroSupport' to support 'package:build'.
https://github.com/dart-lang/build/pull/3650

Change-Id: I9437205dd42335fdba8e59736ef4d6ba557b9aab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352997
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-17 00:13:49 +00:00
eliasyishak 0e5542211c Add parameter for analytics instance
R=sstrickl@google.com

Change-Id: I8ef2fe2c757a7625c2e3aa7eba48513e4c2f4e88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352561
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2024-02-17 00:09:29 +00:00
Nicholas Shahan 3c13e9f273 [ddc] Cleanup dead code from the runtime library
This code is no longer used now that the new runtime types are always
enabled.

Change-Id: I0c7d627199a10e023d5d1afa581812b360e9a0f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344609
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-02-16 22:33:54 +00:00
pq 8b568142b8 augmented enum camel_case_types test case
I think this should ultimately be supported: https://github.com/dart-lang/language/blob/main/working/augmentation-libraries/feature-specification.md#augmenting-enum-values

See also: https://github.com/dart-lang/linter/issues/4881

Change-Id: Ibb8a175b40410599a28f06b2993ce9da92c1838c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352995
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-16 22:05:51 +00:00
Devon Carew e82324990f Bump web_socket_channel to 3db86bc0a09e1038a0fa418262c8a92211c5de69
Changes:
```
> git log --format="%C(auto) %h %s" 5241175..3db86bc
 https://dart.googlesource.com/web_socket_channel.git/+/3db86bc Require Dart 3.3 and the latest pkg:web (326)
 https://dart.googlesource.com/web_socket_channel.git/+/1c4a923 Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (323)
 https://dart.googlesource.com/web_socket_channel.git/+/041aa3c adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (320)
 https://dart.googlesource.com/web_socket_channel.git/+/0e8bedc Allow pkg:web v0.3.0 (306)
 https://dart.googlesource.com/web_socket_channel.git/+/62370cc Bump actions/stale from 8.0.0 to 9.0.0 (312)
 https://dart.googlesource.com/web_socket_channel.git/+/2a0563f Prepare release v2.4.1 (301)
 https://dart.googlesource.com/web_socket_channel.git/+/906c944 CI: test dev SDK with dart2wasm (304)
 https://dart.googlesource.com/web_socket_channel.git/+/a316c53 Rename helper extensions to not collide with pkg:web unreleased (303)
 https://dart.googlesource.com/web_socket_channel.git/+/547184a blast_repo fixes (302)
 https://dart.googlesource.com/web_socket_channel.git/+/969bc6c Fix JS value to Dart conversion when receiving from a web socket (298)
 https://dart.googlesource.com/web_socket_channel.git/+/df096a9 Remove removed lints (299)
 https://dart.googlesource.com/web_socket_channel.git/+/67bf9a3 Drop some use of ! (296)
 https://dart.googlesource.com/web_socket_channel.git/+/d4a8d70 Small tweak (295)
 https://dart.googlesource.com/web_socket_channel.git/+/9e80b8d migrate to pkg web (294)

```

Diff: https://dart.googlesource.com/web_socket_channel.git/+/5241175e7c66271850d6e75fb9ec90068f9dd3c4..3db86bc0a09e1038a0fa418262c8a92211c5de69/
Change-Id: I530ff23837e35b0db386b6710ee0a2ddf747c98a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352994
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-02-16 20:57:06 +00:00
Brian Quinlan 770f44d4e9 [io] Make it possible to change the line ending output by stdout and stderr.
There is a performance impact in:
`stdout.lineTerminator = "\r\n";`

For small writes (<100 chars), the performance loss is lost in the noise of the `write` system call.

For writes of ~500 chars, the performance is about half of that without line terminator translation. But, on a M2 Mac laptop, ~80M characters can be written per second.

Bug: https://github.com/dart-lang/sdk/issues/53161
Change-Id: Icfa0f981dcf6edb856d8aac5e0e270bc0148d498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326761
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-02-16 20:06:03 +00:00
pq 7b63c20fba camel_case_types support for macros
Fixes: https://github.com/dart-lang/linter/issues/4882

Change-Id: I2a70fb7ccd2d55dfcc0045969a861a1b8e158033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352992
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-02-16 19:55:37 +00:00
Srujan Gaddam fe67789e43 [pkg:js] Update README and prep for 0.7.1 publish
Fixes https://github.com/dart-lang/sdk/issues/54792

Added disclaimers to use dart:js_interop going forward instead
and linked to the documentation. Preps for publish.

Change-Id: I62bd65dd879e3569b8cc0d575701f412e63db7c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352964
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-02-16 18:40:22 +00:00