Commit graph

96986 commits

Author SHA1 Message Date
pq
039640fad1 prefer_const_literals_to_create_immutables extension type test
Closes: https://github.com/dart-lang/linter/issues/4722

Change-Id: Ifd60ab27242e802638c072e5957c5c35fe89c399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-31 19:33:37 +00:00
Stephen Adams
565919a80f [js_runtime] Clean up String.trim{Left,Right}
- Use the standardized JavaScript names `trimStart` and `trimEnd`.
- Remove IE11 polyfill.

Change-Id: I9a469b8bf076efd16ef06b88c7fa111784054bb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323300
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-08-31 19:06:29 +00:00
Sam Rawlins
4a9a0dcfdb analyzer: Parse '@nodoc' in a doc comment
Work towards https://github.com/dart-lang/sdk/issues/52705

Change-Id: Icaa0bcb0e58ca07250d135372dc88985b5f1f68c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323423
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-31 18:27:28 +00:00
Konstantin Shcheglov
224a5c7d32 Enable language 3.2 for analysis_server/ and linter/.
Change-Id: Ifba960f2947a6c900c81fc794bfc5ed288cc2e97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-31 17:38:39 +00:00
pq
040c8e3247 allow @immutable extension types
Fixes: #53351

Change-Id: I5afcce3940fe7c01e37e0f133068325ec3fb5579
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323203
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-31 17:00:37 +00:00
Konstantin Shcheglov
702cca5a18 Extension type. Updates and tests for search.
Change-Id: I17c5c9eb5237ba6f090cab974d4419e46b584ac8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323504
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-31 16:02:18 +00:00
MarkZ
d4261d12ff [ddc] Adding a flag for new loadLibrary timing semantics.
This change helps us incrementally roll out changes to breaking tests internally.

Change-Id: I686b76ebf35816db8f875eccc935b957c81104fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323433
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-31 15:56:29 +00:00
Johnni Winther
30e3cf018b [cfe] Declare this variable in constructors
This avoids a crash from reading the this variable before it is
declared.

Change-Id: I604828c83e2179fa63f2037832e82db013fbfe4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323580
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-08-31 13:50:18 +00:00
Johnni Winther
33108ade4b [cfe] Move extension types tests to extension_types/ folder
Change-Id: I1814a11cd4a753f9620b00747aebf021bd6dfca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323540
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-08-31 13:50:18 +00:00
Vyacheslav Egorov
46ac1f653f [vm] Treat Future.then(..., onError:...) as catch all handler
Commit a52f2b9 which reworked awaiter stack unwinding and its
integration with debugger introduced the following regression:
it stopped treating `Future` listeners which had both `onValue`
and `onError` callbacks as catch all exception handlers. Only
listners with `onError` callback (those created with
`Future.onError`) were treated as a catch all handler.

This meant that debugger started to treat exceptions in the
code below as uncaught:

```
Future<void> foo() {
  await 0;
  throw '';
}

await foo().then(..., onError: (e, st) {

});
```

This change fixes this regression by checking if
`FutureListener.state & stateCatchError != 0` instead of
more narrow `FutureListener.state == stateCatchError` which
only detects listeners which only catch errors but do not
handle values. The new predicate matches
`FutureListener.handlesError`.

This relands 38e0046cad
with a fix to ensure that we correctly detect `onError`
callbacks which simply forward to a suspended async
function. We do this by marking FutureListener's that originate
from `await` using a bit in the state.

Fixes https://github.com/dart-lang/sdk/issues/53334

TEST=service/pause_on_unhandled_async_exceptions{_zones,}_test

Fixed: 53334
CoreLibraryReviewExempt: No fundamental changes to _FutureListener implementation, just additional bit to detect that this listener originates from await
Change-Id: I90385fc619cbb52925e075dd5c7b171a31ca4cab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323481
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-08-31 11:47:54 +00:00
Srujan Gaddam
b25873f11c [dart2js] Erase static interop type in static invocation
Static invocations of external factories are casted so that the
result, which is a @staticInterop type, can be treated as the erased
type instead. This CL fixes the issue where the type that it was
casted to was never replaced with the erased type.

Change-Id: Ic6eb529349ea2b5c42f91c2740d501d4f81bc38e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323505
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-08-31 09:10:57 +00:00
Ryan Macnak
54faa31964 [standalone, io] Don't register service extensions in product mode.
dart2js.aot.x64 20942544 -> 20852448 (-90k)

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/45469
CoreLibraryReviewExempt: VM-only
Change-Id: I5ee6a4019af1fa4a0815ac05a42bb4883d74d8a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323503
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-08-30 21:46:17 +00:00
Sam Rawlins
734e9c3c5b analyzer: Report configurations in doc imports
Work towards https://github.com/dart-lang/sdk/issues/50702

Change-Id: If9c3d702f16e609e0d1f2c2bf09ec02a73cd5a54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323427
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 21:26:28 +00:00
Konstantin Shcheglov
bbc3dcbe30 Extension type. Tests for type hierarchy.
Change-Id: Ic0e31bb13efd68a3413429d1ff9110bb9b268e2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323432
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-30 21:18:25 +00:00
Danny Tuppeny
5926a7301b [analysis_server] Fix duplicate fields when extracting widgets
Fixes https://github.com/dart-lang/sdk/issues/53383

Change-Id: Ia985f1c71c99416906bac4669ff61961d32f29fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 21:10:49 +00:00
Danny Tuppeny
4be9016afe [analysis_server] Migrate completion tests to use TestCode
No functional changes, just switching from `withoutMarkers()` and `positionFromMarker()` to use `TestCode` while I was in these files.

There are now approx 130 calls to `withoutMarkers()` remaining.

Change-Id: I71e7fa918d2ef00e7ad64820392920a1f28a7222
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323480
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 21:10:22 +00:00
Paul Berry
0428501a59 Add a CHANGELOG entry for private field promotion.
Bug: https://github.com/dart-lang/language/issues/2020
Change-Id: Iab3ab8fc3656941e7df91681b14a7d4e2355fb3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323502
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-08-30 20:57:25 +00:00
Sam Rawlins
27153e9c26 [analyzer] Canonicalize info strings in doc comment code blocks
Change-Id: I995e7ab063194805c7b8fb7e25a7f7641325d1f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-08-30 20:47:27 +00:00
Dan Chevalier
6c6b8e7666 Initial commit for pkg/service_extension_router
This is the initial stub that will take the changes used in implementing the service_extension_manager.

Fun GIF: https://media.giphy.com/media/10oL2zVIyW2fgk/giphy.gif

Bug: https://github.com/dart-lang/sdk/issues/53297
Change-Id: Iabcabe826b78623fe968c2edf23c271e6ef58bb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322041
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2023-08-30 20:18:12 +00:00
Konstantin Shcheglov
85928aba2a Linter. Remove trailing whitespaces in tests.
Change-Id: I2cad84d9a9a9ecc342493ff64416b3c3f43c7c5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323430
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-30 19:55:51 +00:00
Jake Macdonald
feda2f41ca mark some more analyzer tests as failing
Bug: b/298227442
Change-Id: I7f49b6f4cd65a2693ae60ae1d37a4984cb4db458
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323520
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2023-08-30 19:42:11 +00:00
Nicholas Shahan
8d52ee6547 Revert "[ddc] Add module local caches for new types"
This reverts commit a9fc9ffc4d.

Reason for revert: Breaks some expression evaluation tests in DWDS

Original change's description:
> [ddc] Add module local caches for new types
>
> - Provides fast access for types that are used multiple times in the
>   same module.
> - Enable the existing type table cache when running with new types.
> - Add a similar cache for instantiated generic classes. This cache
>   is used in the current type system as well to help keep the
>   difference between types and classes more clear.
>
> Issue: https://github.com/dart-lang/sdk/issues/48585
> Change-Id: I32103cf0c0bcf9b9771e789c0d04e63a4365a066
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/321320
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Mark Zhou <markzipan@google.com>

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: Ied36cd006249cce32426b8d0b52d3443fdbce59a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323500
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-08-30 19:15:16 +00:00
Devon Carew
b6cabeea5c Update no-response.yml
Closes https://github.com/dart-lang/sdk/pull/53388

GitOrigin-RevId: 55718bbb418d37600da42e7de53ea0c7a285af57
Change-Id: I036092655dd59a6f7844715065385c978799c590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323448
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-08-30 19:03:07 +00:00
Konstantin Shcheglov
ca608ee54e Extension type. Support in ElementLocator.
Change-Id: Icfcaf19a5aaa3b4dfe2b9c1e0b453a261e50ef1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323428
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 18:56:06 +00:00
Konstantin Shcheglov
f722afcf0c Extension types. Support for sorting.
Change-Id: I632b05f9e02283eca663e68d6087230182003e97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323425
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-30 18:55:31 +00:00
pq
5d3d43bf2d remove experiment tests
Fixes: https://github.com/dart-lang/linter/issues/4734

Change-Id: If39807f0a97641d33b879fab7d5c5fc408e69847
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323447
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 18:37:25 +00:00
Siva Annamalai
98b9b6c07c Revert "[vm] Treat Future.then(..., onError:...) as catch all handler"
This reverts commit 38e0046cad.

Reason for revert: https://github.com/flutter/flutter/issues/133677

Original change's description:
> [vm] Treat Future.then(..., onError:...) as catch all handler
>
> Commit a52f2b9 which reworked awaiter stack unwinding and its
> integration with debugger introduced the following regression:
> it stopped treating `Future` listeners which had both `onValue`
> and `onError` callbacks as catch all exception handlers. Only
> listners with `onError` callback (those created with
> `Future.onError`) were treated as a catch all handler.
>
> This meant that debugger started to treat exceptions in the
> code below as uncaught:
>
> ```
> Future<void> foo() {
>   await 0;
>   throw '';
> }
>
> await foo().then(..., onError: (e, st) {
>
> });
> ```
>
> This change fixes this regression by checking if
> `FutureListener.state & stateCatchError != 0` instead of
> more narrow `FutureListener.state == stateCatchError` which
> only detects listeners which only catch errors but do not
> handle values. The new predicate matches
> `FutureListener.handlesError`.
>
> Fixes https://github.com/dart-lang/sdk/issues/53334
>
> TEST=service/pause_on_unhandled_async_exceptions_test
>
> Fixed: 53334
> Change-Id: I374114b7a7b2ef86b7ed6bf7d5e7cf71ba6054dc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323280
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Slava Egorov <vegorov@google.com>

Change-Id: Id20a6929aac93511173c7467caee91e2488696ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323429
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-08-30 18:24:46 +00:00
Konstantin Shcheglov
81bc23067e Don't report unnecessary_parenthesis around SwitchExpression as a statement.
Change-Id: I07c5b2cb93d5a84ed029a08f4af88f04ef88ed81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-30 18:17:49 +00:00
dependabot[bot]
aa4760e961 Bump actions/checkout from 3.5.3 to 3.6.0
Closes https://github.com/dart-lang/sdk/pull/53359

GitOrigin-RevId: 67398006f88722c47857907fd085ac799ae2535d
Change-Id: I2f79fea237987208a3f2e1709c1bc7d6b223c1da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322880
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-08-30 17:49:58 +00:00
Jake Macdonald
abc7a21679 add Builder.report method and Diagnostic class to support macros sending diagnostics
Will follow up with tests once we agree on the API. At the same time I will handle translating any normal runtime errors into error diagnostics.

Bug: https://github.com/dart-lang/language/issues/3234
Change-Id: I2fc22af088f0e50b1877022aa793337850257804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317221
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 17:43:42 +00:00
pq
6a2c9cb826 migrate tighten_type_of_initializing_formals nnbd experiment tests
Fixes: https://github.com/dart-lang/linter/issues/4732

Change-Id: Ia6c0c5c28ddd7dc35dfc4c45dbc28c77a3a70a68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323441
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 17:35:43 +00:00
pq
595b6542a0 migrate unnecessary_nullable_for_final_variable_declarations nnbd experiment tests
Fixes: https://github.com/dart-lang/linter/issues/4733

Change-Id: I6fbcd42719be924e463bb03d1998706f2ab3d645
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-30 17:35:38 +00:00
Alexander Markov
b9045af57b [vm] Cleanup lookups in the library import
Lookup in the library import can be very slow and it is not needed
most of the time. This change makes Library::Lookup{Class,Function,Field}[AllowPrivate]
lookups local in the library and cleans up related or unused code.

TEST=ci

Change-Id: If5a99bce7d712ce3a898395f74d4febac0311048
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323221
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-08-30 17:18:53 +00:00
Sam Rawlins
899c88c997 [linter] Remove 'run test' from command
`dart run test` seems to automatically run `pub get`, which totally
breaks linter (uses pub to get a copy of analyzer).

Change-Id: I16c6c1488aacf4b4f52b9f9f97bcc3dad7eb7c24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323421
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-30 17:11:19 +00:00
Sam Rawlins
520a7c96df [linter] Move prefer_function_declarations tests
Change-Id: Ib0f51425c7594060fd3dbcf9e9d6651ab4aaedf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323420
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-08-30 17:10:50 +00:00
pq
21d50c276f migrate void_checks nnbd experiment tests
Fixes: https://github.com/dart-lang/linter/issues/4731

Change-Id: I97e15192c3ced2575c7db99b31e70a744df3de3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323440
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 16:50:50 +00:00
Konstantin Shcheglov
c168c6f109 Issue 53287. Include enums into consideration for PATTERN_NEVER_MATCHES_VALUE_TYPE.
Bug: https://github.com/dart-lang/sdk/issues/53287
Change-Id: Ie1cc2e8ed4c00b5237795348ed8d41272b397bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323232
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-30 16:49:38 +00:00
Polina Cherkasova
eaf4c2c6eb Bump DevTools DEP to 2.27.0 and devtools_shared to ^3.0.1
Change-Id: I389800b160d6edfe89a7bda45963ff10a96c9e8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323302
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Commit-Queue: Polina Cherkasova <polinach@google.com>
2023-08-30 16:35:40 +00:00
Aske Simon Christensen
168d97c505 [dart2wasm] Avoid updating class ID field to allow it to be immutable
Change the intrinsics for the internal `makeListFixedLength` and
`makeFixedListUnmodifiable` functions to allocate a new object
(pointing to the existing array) instead of updating the class ID of
the existing object.

In combination with the the `struct.new` optimization, this enables
the class ID field to become immutable.

Change-Id: I981a83a3f89f57f6afa0ac9d952d2d662ab42fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323360
Reviewed-by: Jess Lally <jessicalally@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-08-30 16:16:58 +00:00
Danny Tuppeny
eb73dba14d [analysis_server] Add support for additional completion label details
This allows more of the signature and URI to be shown in the full completion list without needing to cursor through each item to see it.

Some examples can be seen in https://github.com/Dart-Code/Dart-Code/issues/2462#issuecomment-1663786808

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

Change-Id: Ib8290f90c31f974271109df7912d230b5e824319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 15:51:03 +00:00
pq
ba9f103a10 migrate unnecessary_null_in_if_null_operators nnbd experiment tests
Fixes: https://github.com/dart-lang/linter/issues/4730

Change-Id: I8128cf93a733f0b002af458961f3626f0de1ab96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323229
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-08-30 15:41:15 +00:00
Sam Rawlins
1288b96e52 Parsing support for doc imports
Work towards https://github.com/dart-lang/sdk/issues/50702

* This adds a `docImport` field to the `Comment` class.
* Doc imports are parsed with the standard Fasta parser and
  AstBuilder.
* We add one static check that `deferred` isn't used. Other
  checks are needed.
* Many tests.
* We need to add support for line splits in a doc comment.
* I think doc comment imports need to be visted by AST visitors,
  but maybe I am wrong...

Change-Id: I06e2b6fe42ef5ce916d46d9a9db35334726677d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322591
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-30 15:35:18 +00:00
Tess Strickland
d6e0590255 [vm/test] Avoid temporary changes to disassemble_optimized under TSAN.
Don't temporarily set FLAG_disassemble_optimized using SetFlagScope
in tests when using TSAN, as it doesn't change the behavior. It only
adds extra output from the test for debugging purposes, and its use
under TSAN can cause flaky results from the TSAN trybot.

TEST=ci

Fixes: https://github.com/dart-lang/sdk/issues/53384
Cq-Include-Trybots: luci.dart.try:vm-tsan-linux-release-x64-try
Change-Id: Ifa97c8784ca84316c784cb772b1a12ad8123a090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323362
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-08-30 14:34:37 +00:00
Alexander Thomas
d12904f278 [dds] Fix sse_smoke_test on Windows
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try
Change-Id: I8993ee16a23bfbaeffaf48f6ef5906a4e90f11fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322703
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-08-30 14:13:37 +00:00
Aske Simon Christensen
e2971da563 [dart2wasm] Consolidate runtime type classes for bottom and top types
This merges the representations for the `Null` and `Never` types into
a single `_BottomType` class and for the `Object`, `Object?`,
`dynamic` and `void` types into a single `_TopType` class.

Since the merged classes behave identically in subtype checking apart
from nullability, this simplifies subtype checking.

Also makes the runtime type representations for these types plus
`Function`, `Function?`, `Record` and `Record?` singletons in order to
simplify their equality and `hashCode`.

Change-Id: Iad51d1042d0f2f01c1190ba3f63edaeb32dac1dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320540
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2023-08-30 08:54:38 +00:00
Aske Simon Christensen
adb2be018f [dart2wasm] Factor isSubtype to compare nullabilities first
Factor `isSubtype` into a comparison of nullabilities followed by a
comparison of the types ignoring their nullabilities. This simplifies
the flow and prepares for a more direct dispatch of the comparison
based on type categories.

Change-Id: I86c8c49783c9b6cfc43e5193fd30008a2e7b34ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319983
Reviewed-by: Ömer Ağacan <omersa@google.com>
2023-08-30 08:54:38 +00:00
Nate Biggs
640c72dd67 [dart2js] Update comments for dump info changes.
Change-Id: Ia6c04d443c70ffad12026d41559c08f3cbfc1a74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323240
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-08-30 02:09:21 +00:00
Kallen Tu
a193e7422d [analyzer] Change final locals to var in const evaluator.
Making local variable style consistent in evaluation.dart.

Change-Id: I733ca65a4d4f001732e1d44818b8f350a274a331
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323227
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-08-29 23:17:38 +00:00
Kallen Tu
af24f1d61a [analyzer] Report more specific diagnostic codes instead of INVALID_CONSTANT.
Add a more specific, but for general use, diagnostic for when the evaluator encounters a type parameter. The errors should match more closely to the CFE errors now.

This CL also tidies up some other areas like `_evaluatePropertyAccess` and produces a better error than `INVALID_CONSTANT` when you try to access something that's not String.length.

Change-Id: I4780e6e52049887a0ee44cdf046968f332527079
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322364
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-29 22:36:02 +00:00
Konstantin Shcheglov
2ee7f1ff0c Issue 32290. Tests only, already works.
Bug: https://github.com/dart-lang/sdk/issues/32290
Change-Id: Ic4581f0a531a9460f8764e8dd190cc50a19de0f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323228
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-08-29 21:44:58 +00:00