Commit graph

90920 commits

Author SHA1 Message Date
Brian Quinlan 6f1d0e5afa Explain that Complete.future must be handled if it is an error.
Change-Id: I31d2e97d7df875607e30023f20c649680d9feaba
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292286
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-04-03 23:55:02 +00:00
Brian Quinlan 17ea08c10c Document that IPv4 are preferred in socket.connect.
Bug: https://github.com/dart-lang/sdk/issues/50868
Change-Id: I8186d95d1a24c77c4cfade533af26695c7a13b24
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293020
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-04-03 23:48:13 +00:00
Konstantin Shcheglov 525376cc88 Fix ConvertToSwitchExpression when SwitchStatement is empty.
Change-Id: Id7ab8319ff5a9e41b353ed1363ce0d5159fe4ff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292984
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 23:44:48 +00:00
Lasse R.H. Nielsen 0386350aa7 Remove code which no longer compiles.
Probably hasn't worked in a while, so it's unlikely
that anything depends on it.

Change-Id: I7b73b92842b897b8367bf48a490a0e25cd306b3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292083
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-04-03 23:40:05 +00:00
Konstantin Shcheglov 4cb8bd0c37 Issue 51931. Fix for LATE_PATTERN_VARIABLE_DECLARATION.
Bug: https://github.com/dart-lang/sdk/issues/51931
Change-Id: I2b3c42389a5184086e66a1fc35c045d2581a2d8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293004
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 22:35:58 +00:00
Kenzie Schmoll 693367be8b Bump DevTools DEP to 2.23.0
Change-Id: Id87896e215fe7be98c1ce32abff0e8911090dda0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292961
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
2023-04-03 22:07:48 +00:00
Paul Berry d78fe25542 Patterns parsing: fix error recovery for switch expression using :
If a user attempts to use `:` instead of `=>` in a switch expression,
we now generate an error at the location of each `:` token (and
otherwise interpret the switch expression in the way the user
intended).

Fixes #50930.

Bug: https://github.com/dart-lang/sdk/issues/50930
Change-Id: I3687fb464b6875424745e664b0d28346b3cd6375
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292982
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-04-03 21:28:41 +00:00
Brian Wilkerson 40973edbb5 Handle type arguments when replacing an empty map pattern
Change-Id: I4c917d60d93a316459f2478cc21a7845af46781b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292920
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 21:02:18 +00:00
Brian Wilkerson aa1f415e4f Add a fix for invalid_inside_unary_pattern
Closes 51915

Change-Id: I378f66d70c083dd5852a9c8a04e3ddf59aff66d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-03 20:56:10 +00:00
Ryan Macnak 70bbee75de [vm] Don't forget an isolate is shutting down when processing a resume command.
Cf. 4443d2d561

TEST=ci
Bug: b/271314180
Change-Id: I28553ef064ee603c076b69f5b887028bb81967ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292460
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-04-03 20:52:36 +00:00
Johnni Winther 0fcdb66666 [_fe_analyzer_shared] Don't add '?' if type is nullable
This adds an `isImplicitlyNullable` property to `StaticType`. This
is used to avoid the `?` suffix when printing implicitly nullable
types such as `void`.

Change-Id: I02d4197688b37c08aef231b249574e3fdd87cf21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292861
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-04-03 20:47:43 +00:00
Konstantin Shcheglov db0dfec609 Issue 51893. Report PATTERN_NEVER_MATCHES_VALUE_TYPE in some cases.
Bug: https://github.com/dart-lang/sdk/issues/51893
Change-Id: Ia7582df3942a077e81f0343e83359c303d152b1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 20:31:45 +00:00
Konstantin Shcheglov bb85a2d183 Fix for UNNECESSARY_WILDCARD_PATTERN
Change-Id: I0afbfdf60d03019b781b6634623565b6b2477dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 20:18:25 +00:00
Nate Biggs 9a999d9d2c [dart2js] Fix non-deterministic sort in codegen.
Change-Id: Ibb0eb3c68e6bbb6c8e2b32f4436695631ac8a55c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292660
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-04-03 20:09:08 +00:00
Konstantin Shcheglov 7f9ec2513a Fix for LintNames.type_literal_in_constant_pattern
Change-Id: I44bc36da4176f6e7cca74b7d0273807734b31a59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 19:51:52 +00:00
Paul Berry bf4a94c625 Fix tearoff of methods from promotable variables.
Fixes #51853.

Bug: https://github.com/dart-lang/sdk/issues/51853
Change-Id: I407a1d5fb8b00f983cfcf106d1f569d0642058c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292764
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-04-03 19:39:59 +00:00
Brian Quinlan 592c486b58 [doc/io] Clarify why not to modify data after IOSink.add
Bug:https://github.com/dart-lang/sdk/issues/31710
Change-Id: Ibd5903aa6c2ed268729ee860973195113596ca6e
CoreLibraryReviewExempt: documentation-only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279263
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2023-04-03 19:15:51 +00:00
Devon Carew 6978049e23 [deps] rev cli_util, collection, dartdoc, ffi, intl, json_rpc_2, lints, markdown, matcher, mockito, path, pool, source_map_stack_trace, sse, stream_channel, string_scanner, test, test_reflective_loader, tools, typed_data, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

cli_util (91747f7..6c318c2):
  6c318c2  2023-04-02  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#81)
  df83fb5  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#80)

collection (0d0e184..30fd0f8):
  30fd0f8  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#277)

dartdoc (0746cda..9be04e0):
  9be04e0c  2023-03-28  Jonas Finnemann Jensen  Allow ID attributes on headings when running with --sanitize-html (#3358)
  8785dd24  2023-03-27  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#3377)
  0944fa32  2023-03-27  dependabot[bot]  Bump github/codeql-action from 2.2.6 to 2.2.9 (#3379)
  e318d34f  2023-03-27  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#3378)

ffi (32f5eef..04fa38a):
  04fa38a  2023-04-03  Daco Harkes  test zero termination of Utf8 string (#147)
  eb93bbb  2023-04-03  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#188)
  2a6b643  2023-04-03  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#189)

intl (fca552f..a958db0):
  a958db0  2023-03-29  Googler  Internal change

json_rpc_2 (0280ac6..aea3bea):
  aea3bea  2023-03-28  Kevin Moore  Fix analysis, bump min SDK to 2.19 (#93)

lints (dfded5e..f09399a):
  f09399a  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#110)
  9581bab  2023-03-25  Parker Lougheed  Fix 'recommended' spelling in README (#109)
  c92e1ca  2023-03-23  Michael Thomsen  Update README.md (#108)
  7134608  2023-02-01  dependabot[bot]  Bump actions/checkout from 3.2.0 to 3.3.0 (#98)

markdown (ecbffa9..d437c85):
  d437c85  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#529)
  3550fe6  2023-04-01  dependabot[bot]  Bump subosito/flutter-action from 2.8.0 to 2.10.0 (#528)
  d1b7907  2023-04-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#527)
  0daf231  2023-03-31  le.chang  Footnote support (#441)
  b96bc08  2023-03-30  Jonas Finnemann Jensen  Prepare a release of 7.0.2 (#526)

matcher (dc310d9..61f4347):
  61f4347  2023-03-21  Nate Bosch  Prepare to publish (#214)

mockito (ed5bd84..28e8eda):
  28e8eda  2023-04-02  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0
  ccb9abf  2023-04-01  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0
  65ee0c4  2023-03-23  Nate Bosch  Expand pub constraint on test_api (#615)
  e6ea7ad  2023-03-23  Nate Bosch  GitHub Sync (#614)

path (24b58a2..cd37179):
  cd37179  2023-04-02  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#139)

pool (694cfd8..338bfb4):
  338bfb4  2023-04-02  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#67)

source_map_stack_trace (45ea368..08a81a8):
  08a81a8  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#37)
  4cbe06e  2023-04-02  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#36)

sse (8c03b73..8c3efdc):
  8c3efdc  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#80)
  e35336a  2023-04-02  dependabot[bot]  Bump nanasess/setup-chromedriver from 1.1.0 to 2.0.0 (#81)

stream_channel (a20ccd4..fe0f5e4):
  fe0f5e4  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#89)

string_scanner (29e471e..f7a656f):
  f7a656f  2023-04-02  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#56)
  fe8c301  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#55)

test (cc0598b..a01b185):
  a01b185e  2023-03-30  Nate Bosch  More smoothly handle missing compiler info (#1980)
  b24b4668  2023-03-27  Daco Harkes  Support native assets (#1975)
  c3828267  2023-03-23  Nate Bosch  Prepare to publish (#1974)
  9035bba8  2023-03-21  Parker Lougheed  Use deps.dev for OpenSSF scorecard results link (#1976)

test_reflective_loader (c4c2d5c..a85a930):
  a85a930  2023-04-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#46)
  27bc418  2023-04-01  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#47)

tools (fb2dada..d40ca93):
  d40ca93  2023-04-03  dependabot[bot]  Bump actions/labeler from 4.0.2 to 4.0.3 (#66)
  4185d6d  2023-04-03  dependabot[bot]  Bump coverallsapp/github-action from 1.2.4 to 2.0.0 (#65)
  b14d5be  2023-04-03  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#64)

typed_data (f858046..d85363d):
  d85363d  2023-04-02  dependabot[bot]  Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (#62)
  0f57d9b  2023-04-02  dependabot[bot]  Bump actions/checkout from 3.3.0 to 3.5.0 (#63)

webdev (c2c8b17..b139649):
  b139649e  2023-03-31  Elliott Brooks  Don't show non-instantiated variables (#2061)
  8437f60a  2023-03-31  Elliott Brooks  Move project-specific getters to `TestProject` instead of `TestContext` (#2052)
  652e040c  2023-03-30  Elliott Brooks  Provide an app entrypoint to DWDS (#2047)
  0afc9eb4  2023-03-30  Elliott Brooks  Add Dart Code Metrics (#2055)
  5fcbb803  2023-03-29  Elliott Brooks  Apply `trailing-comma` lint (#2054)
  5bd21384  2023-03-28  Elliott Brooks  Skip failing webdev integration_test cases (#2051)
  2d8e9c23  2023-03-24  Elliott Brooks (she/her)  Adds a script for the release steps of `dwds` and `webdev` (#2049)
  afee8c74  2023-03-23  Elliott Brooks (she/her)  Reset `webdev`, `dwds`, `test_common` after publishing (#2048)
  4122b234  2023-03-22  Devon Carew  update to the latest mono_repo generated CI (#2044)
  2b6e9182  2023-03-22  Elliott Brooks (she/her)  Prepare Webdev for `3.0.3` release (#2046)
  c3cbd89b  2023-03-22  Elliott Brooks (she/her)  Prepare DWDS  for 18.0.2 release (#2045)
  bb22b3a0  2023-03-22  Anna Gringauze  Make debugger skip same locations in dart  during stepping. (#2043)
  b9499819  2023-03-20  Anna Gringauze  Prepare for variable names changes due to patterns support in DDC (#2042)

Change-Id: I5b8d591d1b906338564cf008f935b17f85ed2813
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292922
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-04-03 19:10:34 +00:00
Konstantin Shcheglov fabe2af5e3 Issue 51762. Update CompletionResponsePrinter sorting.
Bug: https://github.com/dart-lang/sdk/issues/51762
Change-Id: I46019bea72ac1656c97acb9da88da7dc577d8ef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292640
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 19:07:34 +00:00
Ryan Macnak f8076ad47d [vm, compiler] Implement PcRelativeTrampolineJumpPattern for RISC-V.
This is used only for the architecture-independent CodeRelocator_OutOfRange tests, never in real programs.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/48333
Change-Id: Ia79a86a867117a3889caac11f88ded1abadb5329
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292204
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-04-03 18:27:04 +00:00
Srujan Gaddam e95b84ed41 [dart2js] Fix native null assertions for Dart 3
Allows the following semantics:
- If the disable flag is passed, never check
- If we're in non-sound mode, never check to avoid a breaking
change (this was the behavior before)
- If the enable flag was passed and we're in sound mode,
always check
- If we're in sound mode and with >= -03, don't check

Discussion in https://github.com/dart-lang/sdk/issues/50710

Change-Id: If83aaebb2745e4c8bcaa3f5a38ff41d79a869b8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289451
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-04-03 18:05:28 +00:00
Alexander Markov 71b0bb3473 [vm] Allow breakpoints on record assignments
TEST=pkg/vm_service/test/breakpoint_on_record_assignment_test.dart
Fixes https://github.com/dart-lang/sdk/issues/51909

Change-Id: I9a57b0f8374056af5928ab2e4b8bf02fc6d1e171
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292802
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-03 17:55:30 +00:00
Konstantin Shcheglov e2520f88ef Fixes for a couple pattern tests.
Change-Id: I117890c1117dacac9be11bd1775e8bc42a935c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-04-03 17:35:10 +00:00
Danny Tuppeny f1007d4aa2 [analysis_server] Prevent switch-expression snippets showing up in patterns
+ don't assume a semicolon on the end of a switch expression.

Change-Id: Ie141996bc79e3764c70dea66f570ca17046eecdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-04-03 17:34:41 +00:00
Brian Quinlan 69bddeeca1 Make FileSystemEvent and its subclasses final with public constructors.
Bug: https://github.com/dart-lang/sdk/issues/51912
Change-Id: I05f7884e619e3014339f7642c1eeacc8b617155a
Tested: existing unit tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292220
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2023-04-03 17:03:16 +00:00
Johnni Winther 3b56301f3d [_fe_analyzer_shared] Add support for extension members in exhaustiveness checking
This adds support for extension members in exhaustiveness checking. These are different from regular members in that the type cannot be derived from the matched type but instead is determined by the required type of the object pattern.

To support this a new ExtensionKey is added which holds the static type of the property and whose identity is determined by the name of the property _and_ the type of the receiver (taken from the required type of the object pattern).

When expanding properties, the type of the ExtensionKey is used when the
SingleSpace doesn't have the corresponding property instead of looking up the property type on the static type of the SingleSpace.

Closes #51854

Change-Id: I7a54005972d0640b7dc79e92950bf6d1f89c3fd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292741
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-04-03 16:47:33 +00:00
Chloe Stefantsova d758cf1392 [cfe] Report more errors on mismatching joint variables
Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Ie3dd75209f40681590e378138cbe2b86a5e1619f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292361
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-04-03 16:41:54 +00:00
Daco Harkes 7cfab4e12c [infra/ffi] Skip FFI tests on simulator
Some recent infra shuffling [0] caused FFI tests not to be ingored on
some simulator architectures.

FFI is not supported on simulators, so ignore tests.

[0] https://dart-review.googlesource.com/c/sdk/+/286360

Bug: https://github.com/dart-lang/sdk/issues/48365
Change-Id: Id623733e89f4269feabbe1f1212bdb64a43d7540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292821
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-04-03 16:14:02 +00:00
Paul Berry f537137c67 Patterns parsing: eliminate an unnecessary TODO.
The grammar was updated in
f06d416a1a
so that it now matches the implementation.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I2aa7d395360c96e39b77336c46f415f1b2280439
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-04-03 15:55:09 +00:00
Paul Berry 8d16c1dc87 Patterns parsing: improve error recovery for late in patternVariableDeclaration.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: Id706ff0afab3f14d817fbf99112f772d1f1f7817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292800
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-04-03 15:04:07 +00:00
Derek Xu d947cd69ef [VM/Service] Add test that steps through an inline class method call with the debugger
TEST=CI

Fixes https://github.com/dart-lang/sdk/issues/49746
Change-Id: I2637efeb53856466a47611b28a91d5d6828ecdc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292380
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-03 14:59:00 +00:00
Danny Tuppeny 57ba99c2d3 [dds/dap] Handle sentinel values in Scopes and Variables requests
Fixes https://github.com/dart-lang/sdk/issues/51916.

Change-Id: I72f02c640084059af5e2b761554ee6ec706f5f6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-04-03 14:50:12 +00:00
Lasse R.H. Nielsen 51cbaed621 Reland "Fix bug in Completer.complete."
This is a reland of commit 3688a4723c

Original change's description:
> Fix bug in Completer.complete.
>
> When given a completed `_Future`, it would complete its own future synchronously.
>
> Fixes #48493.
>
> Bug: https://github.com/dart-lang/sdk/issues/48493
> Change-Id: Ic4a68389b5a009ef52b3875bf03a3bafb493f79a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234981
> Reviewed-by: Nate Bosch <nbosch@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>

CoreLibraryReviewExempt: Bugfix.
Bug: https://github.com/dart-lang/sdk/issues/48493
Change-Id: If3a240b5b6eb016e8abe9a2c7551bfcaeea0da4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278920
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-04-03 14:22:26 +00:00
Ömer Sinan Ağacan 4ecbae0aaf [dart2wasm] Update switch-case compilation
With https://dart-review.googlesource.com/c/sdk/+/289224 the front-end
can now generate switch-case expressions where type of the `switch`
expression is different than the types of expressions in `case`s.

To handle this case we have two options:

1. Compare type of `switch` and `case`s and compile the code to just
   evaluate the switch expressions and the default case.

2. Use reference equality

This CL implements (2) as it's simpler and no correct code will have a
switch-case with differently typed switch and case expressions.

Fixes #51793,

Fixes tests:

- co19/Language/Statements/Switch/execution_t01
- co19/Language/Statements/Switch/type_t01
- co19/Language/Statements/Switch/type_t02

Change-Id: I7eece161249498cf19c9f5245b3898c15a721b60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290063
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-04-03 14:17:49 +00:00
Martin Kustermann e1c2192110 [vm] Make writeHeapSnapshotToFile() API public in dart:developer
This API can be used by app developers that want to diagnose high
memory consumption by dumping state of Dart VM heap at specific
points in their apps code and later analyzing those dumps offline
(e.g. using the tool in `<sdk>/runtime/tools/heapsnapshot`).

TEST=Existing test suite.

Change-Id: I04de6ba564f7b9eaf8b59d41fc4b3ec35ce8d2e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279972
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-04-03 12:25:55 +00:00
Johnni Winther 9d557edcd8 [_fe_analyzer_shared] Rename fields to properties
Change-Id: I2458867b6dbc770335f12f3d52a0eb4fb67516be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292721
Reviewed-by: Paul Berry <paulberry@google.com>
2023-04-03 12:16:43 +00:00
Paul Berry d2df7ce24a Update comments and readmes to specify dart run --no-pub when necessary.
Now that https://dart-review.googlesource.com/c/sdk/+/291500 has
landed, `dart run` now tries to invoke `dart pub` before execution.
This doesn't work when running scripts inside the SDK, because the SDK
doesn't use pub to get its dependencies.  So scripts in the SDK now
need to be run with `--no-pub`.

Change-Id: Ic320b717b2d45278cd26d373ae0823c2935ce102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292720
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-04-03 12:11:49 +00:00
Jonas Termansen c57cbd0c19 Ignore constant_identifier_names issue on simarm_x64 constant.
Change-Id: Ieff510d5622bd48aa3a8260a430b1e89529bd00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292742
Reviewed-by: Ömer Ağacan <omersa@google.com>
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2023-04-03 11:55:59 +00:00
Johnni Winther af8eee9960 [cfe] Use required type for object patterns
This uses the required type instead of the lookup type for object
patterns to ensure that extension members are accessed correctly.

Change-Id: I05b4765f1fa3f85acd005a0484349b467cff7c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292703
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-04-03 10:53:44 +00:00
Johnni Winther 23f09803e2 [cfe] Mark pattern variables as having a declared initializer
Closes #51710

Change-Id: I204ec4b671835b8d51056871ab89365d9afb78b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292702
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-04-03 10:08:46 +00:00
Martin Kustermann 6e252d9793 [vm] Allow sending objects across isolates that implement (but not extend) [NativeFieldWrapperClass]
There are currently users that implement classes (e.g. for mocking
purposes) that implement/extend NativeFieldWrappers and send such
objects across isolates.

This CL ensures such mocks can be sent across isolates again (which was
disabled in breaking change in [0]) as long as mocks do not extend NFW
(and therefore have actual native fields).

In the future the [NativeFieldWrapperClass]s will be marked as `base`
and therefore prevent implementing them, see issue [1].
=> At this point this CL can be reverted again.

[0] https://dart-review.googlesource.com/c/sdk/+/289027
[1] https://github.com/dart-lang/sdk/issues/51896

TEST=adjusted isolate tests

Change-Id: I5fe1110e7046761e3606927063d3ad5e2b4bf4e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292320
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-04-03 07:49:25 +00:00
Johnni Winther b28d43b3d3 [_fe_analyzer_shared] Base WrappedStaticType on _BaseStaticType
The WrappedStaticType was wrongly based on the NonNullableStaticType
even though it could be nullable through its components. This made
the WrappedStaticType(Null, T & bool), i.e the Null type that is also
implicitly a T, which is the nullable part of T & bool?, not seen as
a subtype of Null.

The WrappedStaticType is moved to be a subclass of _BaseStaticType and
the isSubtypeOf implementation is updated accordingly.

Closes #51897

Change-Id: I6ac87c56d709b85f0db28efd327ff41b220ea00d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292701
Reviewed-by: Paul Berry <paulberry@google.com>
2023-04-03 07:21:34 +00:00
Brian Wilkerson 49263509a9 Update the quick fix status file
Change-Id: I6f4040ff9b05c1edda658673dd190789b965a543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292700
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-04-03 04:13:40 +00:00
Paul Berry 489aefbe80 Patterns parsing: add error recovery tests.
Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: If63ee17234f0b63ebbdfda8a046350def8851472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292662
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-02 23:32:17 +00:00
Paul Berry 45429b3f7f Patterns parser: remove bogus error recovery logic.
The "recovery" condition `|| /* recovery */ optional(':', next)` had
no effect, because that case was already covered by the previous `if`
statement.

Bug: https://github.com/dart-lang/sdk/issues/50035
Change-Id: I4eeeeb2ff6b3558888f07c65d85e9f79e334d9eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-02 23:30:36 +00:00
Sam Rawlins afe69edb1c Correct deprecated-use message for constructors
Change-Id: I9e8535a63ef9baeb741cb9f5d47015590b8031e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-04-02 21:23:01 +00:00
Paul Berry 22a8877452 Patterns parser: test that dynamic can be used in an object pattern.
This resolves a TODO in the patterns parser implementation.

(Note: the TODO says to file an issue, but there is no need; the spec
clearly states that `dynamic` is allowed).

Change-Id: I2ebbf5401052ce5b96679ac3cf8a1aba3cd384d4
Bug: https://github.com/dart-lang/sdk/issues/50035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292541
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-04-02 12:28:58 +00:00
Ryan Macnak 58a3324adf [infra] Remove old AOT NNBD configurations.
Change-Id: I2d444f5c6735197d9bfcb10863ff5a9f34b580f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286361
Reviewed-by: Alexander Thomas <athom@google.com>
2023-04-02 08:34:23 +00:00
Ryan Macnak fdabbc9d10 [infra] Add configurations to rename AOT NNBD.
Change-Id: I56044e0fcfdb4623595971354a01164d8ae708e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286360
Reviewed-by: Alexander Thomas <athom@google.com>
2023-04-02 08:34:23 +00:00
Konstantin Shcheglov 30a8b2ee4b Use raw strings for assertResponse() that don't do any interpolation.
We use this pattern to find expectations to update.

Change-Id: Ibae370cfdf85dd83122b5571f3a05d86355c647f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290344
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-04-02 00:33:28 +00:00