Commit graph

92319 commits

Author SHA1 Message Date
Ludi Zhan
4079a47cc4 [analyzer] Introduce a new annotation @visibleOutsideTemplate
The new annotation is intended to be used on members of class, enum or mixin to opt out the @visibleForTemplate visibility restriction cascaded from class- / enum- / mixin- level.

1. Throw warning if the annotation is added to a invalid target.
2. Update @visibleForTemplate diagnostics logic to opt out members annotated with @visibleOutsideTemplate.

Change-Id: Iec546fc7785cd45f39a1b2a2cc8849ef1cf9d04a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304825
Reviewed-by: Marya Belanger <mbelanger@google.com>
Auto-Submit: Ludi Zhan <ludizhan@google.com>
Commit-Queue: Ludi Zhan <ludizhan@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-08 18:47:15 +00:00
Konstantin Shcheglov
f569174ea0 Stop using elementMatcher() method, use textual expectaitons.
Change-Id: I11946d135a4e82e8fcdd382d3c4cc50e6ab1666f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308163
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-08 18:27:14 +00:00
Ömer Sinan Ağacan
b123b29335 [dart2wasm] Fix continue compilation in switch in async code generator
`continue` in `switch` statements need to be compiled the same way as
normal `continue`/`break` to run finalizers between the jump target and
the `continue`.

New passing test: co19/Language/Statements/Continue/async_loops_t10

Change-Id: I0cdff74b8b296691c8a90404b424487b00343427
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307780
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-06-08 17:12:51 +00:00
Devon Carew
8357b8aea4 [deps] rev dartdoc, http_parser, leak_tracker, path, pool, term_glyph, typed_data
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (449478c..2a39574):
  2a395741  2023-06-07  Sam Rawlins  Seal mustachio nodes (#3433)
  d5bb24b2  2023-06-07  Sam Rawlins  Convert Tuples to Records and split a helper out from findCanonicalModelElementFor (#3432)

http_parser (1ef3e56..19466c0):
  19466c0  2023-06-07  Kevin Moore  Require Dart 3.0, update lints (#74)

leak_tracker (f17da61..fc45bec):
  fc45bec  2023-06-07  Polina Cherkasova  Break the leak tracker code to packages. (#80)

path (f8d15c2..592505f):
  592505f  2023-06-07  Kevin Moore  Require Dart 3.0, update lints (#146)

pool (a10a0f9..c6b1b2c):
  c6b1b2c  2023-06-07  Kevin Moore  Require Dart 3.0, update lints (#71)

term_glyph (9d8956f..4daa34e):
  4daa34e  2023-06-07  Kevin Moore  Require Dart 3.0, update lints (#39)

typed_data (693f48e..8d29573):
  8d29573  2023-06-07  Kevin Moore  Require Dart 3.0, update lints (#67)

Change-Id: I11fe765858ba970f13a2051abee34abf910f4698
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2023-06-08 17:09:00 +00:00
Brian Wilkerson
f197c63616 Convert argument list contributor tests
Change-Id: I998bc7a23e83541b10c38596f66a7496fb3d9682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307974
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-08 16:33:47 +00:00
Konstantin Shcheglov
4ff67a7ccb Remove assertMember(), use textual expectations.
Change-Id: I009a17ba1ffecd7614577b73f191a954cb9d3680
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307976
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-08 15:59:07 +00:00
Ryan Macnak
27f5a8c175 [test] Increase timeout for ARM64 Linux (but not Windows).
Several tests seems to be just at the current timeout threshold and flaking between timeout and their normal outcome.

Cf. 87362c6f42

Bug: https://github.com/dart-lang/sdk/issues/52589
Change-Id: I4e89aa71618c51a9ca1d38e8d03fffbcd919a744
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307972
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-06-08 15:20:11 +00:00
Johnni Winther
c308c9327d [cfe] Ensure Member.isInlineClassMember is set
TEST=existing

Change-Id: I16fbeb0bbe431e3f85ed11c21e0506e6aa4abf58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302206
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-06-08 15:02:03 +00:00
Danny Tuppeny
aa51ed6bca [dds/dap] Fix typos in DAP readme
Change-Id: Ib2d7b3ce14d3b337a7612eb1c1b1da4a76a7fef9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308100
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-06-08 14:54:14 +00:00
Daco Harkes
984ea72af5 [pkg] native_assets_builder build mode
Manual roll of: https://github.com/dart-lang/native/pull/62

Bug: https://github.com/dart-lang/sdk/issues/50565
Change-Id: Ie5b9ef9e9cdfbb9c19eac299f9f0294496b77520
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-linux-release-try,pkg-linux-debug-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308040
Reviewed-by: Hossein Yousefi <yousefi@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-06-08 13:35:23 +00:00
Vyacheslav Egorov
0b62bb66ed [vm/io] Make sure to write until EAGAIN on POSIX
We are using `epoll()` in edge-triggerred mode, which requires
us to hit `EAGAIN` on `write()` before we are guaranteed
to receive an `EPOLLOUT` event.

`_SocketStreamConsumer` looks at `_NativeSocket.writeAvailable`
after issuing a `write` to decide whether it should continue
writing or pause and wait until event handler sends us `writeEvent`.

However we did not previously set `writeAvailable` to `true` until
the first `writeEvent` arrived, which lead to a hang on some
Linux servers: we would write a small amount of bytes into a pipe
and then wait for `writeEvent`, which would never come, as `epoll()`
is only guaranteed to wake up with `EPOLLOUT` if we hit `EAGAIN`
on `write()`.

This CL also changes `_NativeSocket.nativeWrite` implementation
to write bytes into the file descriptor until it gets EAGAIN.
This reduces the number of roundtrips between Dart and
native.

Unfortunately this CL does not come with a regression test
because it is relying on concrete `epoll()` behaviour and it this
behaviour does not reproduce for me.

TEST=Tested manually on the affected servers.

FIXED=b/286346121

Fixed: 286346121
Change-Id: I37fef9aa12b1da724b035aa9577b414a8057217e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308101
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-08 13:17:28 +00:00
Christophe B
b66afce6ca Add missing void in function declarations to avoid warning
Closes https://github.com/dart-lang/sdk/pull/52563

GitOrigin-RevId: e7577ad346046a30712fbec61243af2779f24c72
Change-Id: I066f363f4197171cdb45f8679279239f780a59ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307880
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-08 13:16:18 +00:00
Tess Strickland
766a2be5a4 [pkg/vm_snapshot_analysis] Use program.stubs as owner for TTS stubs.
Also remove the '<anonymous signature>' check, since we stopped
generating function objects for function types before the current
minimum SDK version for the package.

Change-Id: I47c0522ae4ba778221ee98f93fdae8c22a57d688
Bug: https://github.com/flutter/flutter/issues/128402
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307860
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-06-08 11:48:58 +00:00
David MARKEY
a731af1703 Annotate DateTime.timestamp() with Since("3.0").
Closes https://github.com/dart-lang/sdk/pull/52638

GitOrigin-RevId: ea045c0aa761981613f6d8e36eeeb389c8224053
Change-Id: Idc601b6a8069f2ed504df646862faf412de9a1b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308020
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-06-08 11:06:49 +00:00
Johnni Winther
7cfbb9ee96 [vm] Update test expectations
Expectation output changed by https://dart-review.googlesource.com/c/sdk/+/307121

TEST=existing

Change-Id: I7267d6c09a3a41d4a428cdf3b4507a57049459c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307862
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-06-08 09:11:27 +00:00
Johnni Winther
82e3a751a9 [cfe] Remove unnecessary_null_comparison code
The frontend is now run with sound null safety so these are no longer needed.

TEST=existing

Change-Id: I6c1776845854695ff34e310a3bb5bc9d86715f06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307901
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-06-08 08:46:47 +00:00
Ömer Sinan Ağacan
e8f370ca4e [dart2wasm] Implement noSuchMethod on null receivers
New passing tests:

- language/closure/tearoff_dynamic_test
- language/no_such_method/native_test

Change-Id: I42449f3e238ab5ecd02504d65ff1a696a76bb7a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307800
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-06-08 08:44:36 +00:00
Johnni Winther
46c0a9d43b [cfe] Fix _Enum in default sdk
This fixes pkg/front_end/test/compile_dart2js_with_no_sdk_test.dart which
failed with a non-null check error in exhaustiveness checking because
all enums where generating invalid constants.

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

Change-Id: I817dd44324104242cff50a7239231ec3ad550d26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307900
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-06-08 08:17:18 +00:00
Johnni Winther
ccb21bd54b [kernel] Add RedirectingFactoryTarget to FunctionNode
This replaces the RedirectingFactoryBody with a dedicated
RedirectingFactoryTarget object on FunctionNode.

TEST=existing

Change-Id: I3cc8b9f8abf938c6d60fdbc91b1f4210686fc359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307082
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 08:04:15 +00:00
Johnni Winther
36641368bb [cfe] Treat NonNullableByDefault as default in ast-to-text
This changes ast-to-text to mark legacy libraries instead of
non-nullable-by-default libraries.

TEST=existing

Change-Id: Ib01147e4ef48c2c5b2ffc6b23547998344dfdf2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307121
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 06:28:50 +00:00
Konstantin Shcheglov
25dc2147bb Separate testFile and testFilePath in server tests.
Change-Id: Icc11f0c7f1642471cc01a0046e2a04801efba084
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307967
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-07 23:56:09 +00:00
Devon Carew
526e670908 Bump html to b3b820bc36ed17673268360d8b569bdc66c22123
Changes:
```
> git log --format="%C(auto) %h %s" 92eacab..b3b820b
 https://dart.googlesource.com/html.git/+/b3b820b widen the dependency on 'package:csslib' (217)

```

Diff: https://dart.googlesource.com/html.git/+/92eacabadf40aa24c8f4289682ef2822c5d7e414..b3b820bc36ed17673268360d8b569bdc66c22123/
Change-Id: Ibacc756c3d1ad03d190fb534757c5fbc42a5a105
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307969
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-06-07 22:18:30 +00:00
Danny Tuppeny
fb0b139358 [analysis_server] Improve performance of checking and running "dart fix"
Running the check for whether to prompt about "dart fix" in the LSP server with the whole Flutter repo open took around 45s before, and around 0.45s after. Almost all time was spent resolving libraries but now resolution is skipped for any libraries that don't contain fixable errors.

In my testing, "dart fix" (from source) didn't see any significant gains (around 46s down to around 43s for flutter/packages/flutter in my testing).

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

Change-Id: I0db63f5d54c7c262fe16aeb825f817cf526199c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-07 22:03:36 +00:00
Kallen Tu
3542e86611 [analyzer] Fix CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST not reporting.
Found a bug related to https://dart-review.googlesource.com/c/sdk/+/307182 which
surfaced the fact that we don't handle InvalidConstants in ConstantVerifier._validateFieldInitializers.

Change-Id: If270faa4718f67a930f8ec5ea32f1dd1d8a7e97c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307966
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-06-07 21:30:34 +00:00
Derek Xu
6ca0693c28 Revert "[VM/Service] Add code for working with Perfetto protos to package:vm_service"
This reverts commit 6c3c34560e.

Reason for revert: We will put the proto bindings in a separate package to prevent introducing new transitive dependencies into package:flutter.

Original change's description:
> [VM/Service] Add code for working with Perfetto protos to package:vm_service
>
> TEST=get_perfetto_vm_timeline_rpc_test and
> get_perfetto_cpu_samples_rpc_test
>
> Change-Id: I23a30629f1d7a8cd7e2c9daad2d02fae4decb338
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302421
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I3bd9ce8a09e131271f76fe46ca92288f888d6147
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307968
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-06-07 21:28:00 +00:00
Nate Biggs
3b4d753b8e [cfe] Fix constant subtyping to recursively check record with special JS number subtyping logic.
ConstantEvaluator.isSubtype contains special logic to handle JS number subtyping. It then delegates any recursive subtype checking to TypeEnvironment.isSubtypeOf. TypeEnvironment.isSubtypeOf is not aware of the JS context and has no special logic for JS numbers. This leads to inconsistent behavior when numbers are nested in records. The special number logic is never applied to those nested types.

Fixes: https://github.com/dart-lang/sdk/issues/52619
Change-Id: I72c64bb0544aea79bd83bc589abdda96c851525c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307720
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-06-07 20:11:37 +00:00
Joshua Litt
ab63ac59bf [js] Disable strict mode checking except for testing.
This will enable legacy JS interop semantics on Dart2Wasm.

Change-Id: I18cf2af2ea7e1bd1061e16d62224f25bb41f0332
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307960
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-06-07 19:52:43 +00:00
Mihail Slobodyanuk
a4b25027fe Fix Socket remoteAddress obtaining on Win32 #51778
Closes https://github.com/dart-lang/sdk/pull/51981

GitOrigin-RevId: de22efdd25a716b6c7eac086e2cb12e8793554f5
Change-Id: If1d8247f7e0188c47c19e19f33732a56493d21d8
Bug: https://github.com/dart-lang/sdk/issues/51778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294220
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2023-06-07 19:32:49 +00:00
Ryan Macnak
884be01ec3 [vm, gc] Add option to madvise(DONTNEED) when sweeping.
- More expensive sweeping that will also slow down the mutator from more TLB invalidation
 - Might cause OOM sooner from PTE fragmentation
 - Won't decrease the Dart heap capacity stat
 - Unclear how often holes are at least page sized

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/52571
Change-Id: I54011e451bf0ad21859c11023d1c4123cc0fa435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306902
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-06-07 19:01:51 +00:00
Janice Collins
80a9e513a7 [deps] rev dartdoc, lints, native, webdev
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (0c8feac..449478c):
  449478c7  Tue Jun 6 20:04:19 2023 -0700  Sam Rawlins  Search: specify package rank in generation; distinguish non-core Dart libs (#3427)
  81af1bf3  Tue Jun 6 17:31:02 2023 -0700  Janice Collins  Prepare for dartdoc 6.3.0. (#3430)
  2b7340d3  Tue Jun 6 17:30:40 2023 -0700  Sam Rawlins  Explicitly export Kind; for internal customer (#3431)
  896540c0  Mon Jun 5 19:39:10 2023 +0000  dependabot[bot]  Bump github/codeql-action from 2.3.5 to 2.3.6 (#3429)

lints (fc74ce0..4b79906):
  4b79906  Tue Jun 6 15:15:22 2023 -0500  Parker Lougheed  Link to 'dart fix' docs in table header (#132)
  b7766d6  Tue Jun 6 09:05:20 2023 -0700  Devon Carew  add 'has quick-fix' checkboxes to the package's readme (#131)

native (c851e69..973f3ed):
  973f3ed  Tue Jun 6 10:26:58 2023 +0000  Daco Harkes  [native_assets_cli] Add `dry_run` option (#59)

webdev (b10d62b..3d7f546):
  3d7f546f  Mon Jun 5 16:24:16 2023 -0700  Elliott Brooks  Add Webdev installation test (#1935)
  9297c663  Mon Jun 5 14:31:43 2023 -0700  Elliott Brooks  Remove unnecessary `async` keywords(#2130)
  6b112b06  Mon Jun 5 12:45:34 2023 -0700  Elliott Brooks  Run DCM workflow against PR branch (#2131)

Change-Id: I6728516c13c1d45f8bbd65c266076c6028ed45ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307962
Reviewed-by: Devon Carew <devoncarew@google.com>
Auto-Submit: Janice Collins <jcollins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-06-07 18:27:36 +00:00
Mark Zhou
af24e995c9 [ddc] Attaching default type arg member signatures to JS native types.
Fixes 'member not found' issues arising from accessing default type arguments from JS literals.

Change-Id: I7cdfddcd70ee42a2941c8cb666570e161077281b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307513
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2023-06-07 17:57:26 +00:00
Danny Tuppeny
565379aaec [dds/dap] Respond to DAP launch request before sending runInTerminalRequest
Currently when the user configures a Dart CLI program to be run in the terminal, we ask VS Code to launch it in the terminal before we respond to the launch request. This (depending on settings) can cause VS Code to show the terminal and then switch to the Debug Console (which is both confusing and frustrating for users that opt-in to do this to access stdin of the terminal process).

This change reverses the order when using `runInTerminal` so that `launch` is responded to first.

See https://github.com/microsoft/vscode/issues/168295

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

Change-Id: If9a221361cc3329fb86fb17ba532043266b3438c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307481
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-07 17:31:03 +00:00
Konstantin Shcheglov
692ef6be03 Add quotedAndCommaSeparatedWithOr and use for TransformSetParser.
Change-Id: Ie599d1e7b24efa137cb342392d278df051fbed33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307666
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-07 17:19:59 +00:00
Konstantin Shcheglov
8e37b41c05 Issue 52624. Report type parameters in NamedType(s) inside constant patterns.
Bug: https://github.com/dart-lang/sdk/issues/52624
Change-Id: Ic779641025fdf9d80b67457a26c704c5481e57ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307663
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-07 17:13:58 +00:00
Srujan Gaddam
0784c4d868 [dart:js_interop] Warn on initializers when using static interop
Non-strict mode static interop can still use initializers on types
like String. We should warn in this case so users don't think that
the initializers will be used with invocation-level lowering. Note
that strict mode does not need to worry about this as JS types can
not have a const initializer.

TEST=Manual as our static error checking doesn't handle warnings.
Change-Id: I4e2eeda35ca82b86adf75f6eaf069764b3c13ae7

Change-Id: Ic23bd69e652ff4f083157021777d9cf46f4a7f7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307512
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-06-07 17:11:56 +00:00
Alexander Markov
5b6512f54e [vm/aot] Disable signature shaking for 'this' of inline class members
Specification of inline classes has the following rule for
closurization (tear-off creation) of inline class members:

> The operator == of the closurization returns true if and only if
> the operand is the same object.

This means that each time tear-off is taken, a new closure should be
created which compares equal only to itself. This is true iff that
closure has a non-empty context which captures 'this'.

Signature shaking can remove 'this' parameter if it is not used
and this affects equality of the tear-offs of inline class members.
This change prevents that by marking 'this' parameter of inline
class members as checked.

TEST=co19/LanguageFeatures/Inline-classes/dynamic_semantics_member_invocation_A02_t03
TEST=co19/LanguageFeatures/Inline-classes/dynamic_semantics_member_invocation_A03_t03

Issue: https://github.com/dart-lang/sdk/issues/49737
Change-Id: I4cf4f5afdb6c83a1b1eccf587cafcf9a9ca5178a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307665
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-06-07 16:02:13 +00:00
Alexander Markov
c82672780a [vm/aot/tfa] Tree-shaking of inline classes
TEST=pkg/vm/testcases/transformations/type_flow/transformer/inline_class.dart

Issue: https://github.com/dart-lang/sdk/issues/49737
Change-Id: I48faba0767994d254590b311380245718895173e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307661
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-06-07 15:31:34 +00:00
Devon Carew
fcddfd3b85 Bump csslib to be2e11eedd4b1f12a674fd9246b9f8dd2da9aa5d
Changes:
```
> git log --format="%C(auto) %h %s" b2b9b55..be2e11e
 https://dart.googlesource.com/csslib.git/+/be2e11e rev to 1.0.0 (185)

```

Diff: https://dart.googlesource.com/csslib.git/+/b2b9b55ada8ba0c6efb1eb9db0983ac4f6ab522d..be2e11eedd4b1f12a674fd9246b9f8dd2da9aa5d/
Change-Id: I053b120e2032f5eda2a888745d20e8abe253aa75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307668
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-06-07 15:05:12 +00:00
Martin Kustermann
219bf34064 [vm/ffi] Simplify some aspects of ffi callback metadata implementation
Make the free and allocated lists simply linked lists of `Metadata*`
(instead of `Metadata*` pointing to Trampoline, which - via some
logic - can be translated into next `Metadata*`).

Make the layout of the virtual address space mapping and
offsets `constexpr` functions instead of computing them at
runtime & caching in fields.

Use `uword` to represent `Trampoline` entrypoint (as we generally
use `uword` for `Code.EntryPoint()` / ...)

TEST=ci

Change-Id: If4ffa11712acc46c9295b609caff7576d2354fe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/305983
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-06-07 10:51:31 +00:00
Vyacheslav Egorov
74285a6e31 [io] Take pending writes into account in _SocketStreamConsumer
On Windows `_NativeSocket.nativeWrite` returning to caller does
not mean that the data was flushed into OS buffer. Overlapped
operation might still be in progress - and it will be cancelled
with data loss if we close the handle.

This means _SocketStreamConsumer should take such pending writes
into account and not issue `done` event until pending write
completes.

This change prevents data loss when communicating with
subprocesses on Windows. Previously even doing
`await process.stdin.flush()` would not guarantee data
delivery.

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

TEST=tests/standalone/io/regress_50904_test.dart

Cq-Include-Trybots: luci.dart.try:vm-win-release-x64-try,vm-win-debug-x64-try,pkg-win-release-try
Change-Id: I13ab2cc3ce45f1ff8cb3183884d26bbb2b72f7ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307043
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-06-07 09:49:35 +00:00
Ömer Sinan Ağacan
8144a29966 [dart2wasm] Fix initializing exception variables
Currently setting exception variables in `catch` blocks assumes that the
variables are not captured and always creates a new local for the
variable.

This CL adds a new function for initializing a variables. The
implementation is similar to `VariableDeclration` visitor and handles
captured (updated or not updated) and non-captured variables. This
function is then used in `catch` blocks to initialize exception and
stack trace variables.

New passing tests:

- co19/LibTest/async/Zone/handleUncaughtError_A01_t04
- lib/async/future_test

Fixes #52556.

Change-Id: I428d8f30ab1509b5b4439f8136190134741dd4ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307042
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2023-06-07 09:34:17 +00:00
Konstantin Shcheglov
bdd145a39a Issue 52601. Extend 'Create constructor for final fields' to support enums.
Bug: https://github.com/dart-lang/sdk/issues/52601
Change-Id: I3e8dcc288864ca7c68992cb1218e66b2d34c5aa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307669
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-06-07 02:11:27 +00:00
Konstantin Shcheglov
5cb4093613 Issue 52432. Create DefaultSuperFormalParameterElementImpl for invalid code.
Bug: https://github.com/dart-lang/sdk/issues/52432
Change-Id: I03a1320dce1a56448046bf625ae751cdb8f931af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307670
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-07 01:32:58 +00:00
Danny Tuppeny
3beb26c531 [analysis_server] Support iterative "fix all" through LSP
Fixes https://github.com/dart-lang/sdk/issues/47968.

Change-Id: I7e96199c971d98ef46715c87e7c0dbe6ffae49ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/304340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-06-07 00:32:00 +00:00
Mayank Patke
3b850bb1ac [js-rti] Support legacy types in is FutureOr specializer.
Change-Id: Ia8bbf6fe9a7ae03fc6982a8b93ffdef019ab9540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307667
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2023-06-06 22:09:28 +00:00
Devon Carew
dcac780851 Update PULL_REQUEST_TEMPLATE.md
Closes https://github.com/dart-lang/sdk/pull/52618

GitOrigin-RevId: ebe1c27a4fde2f682c76102130f2423035ae10bc
Change-Id: I73210c0091ad4a07ab4536b373eabf2dbce47216
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307560
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-06-06 21:59:50 +00:00
Srujan Gaddam
5b3a57908d [dart:js_interop] Remove ObjectLiteral
This annotation is unneeded as named arg external constructors
is enough to determine if an object literal is created. The one
exception is an empty object literal, but our guidance is to use
utility functions to create one instead. This is a better fit for
that purpose too as an interface for an empty object literal is
more uncommon.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I10cf891601b28ff7e56129842d099ea28863626d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307506
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-06-06 20:50:36 +00:00
Danny Tuppeny
30b9ac9f87 [dds/dap] Don't show skipped tests as passes in debug adapter output
Fixes https://github.com/Dart-Code/Dart-Code/issues/4505

Change-Id: Ic57e5f05b62cc09194c3444437b5303f4ca54830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306701
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-06-06 19:49:32 +00:00
Konstantin Shcheglov
79b71c789f Use ParameterReference for ChangeParameterType.
Change-Id: Iad7f840d7342b4868529aea1e3767a79739dd18d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307662
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-06 19:34:20 +00:00
Kallen Tu
bc94e7662b [analyzer] Refactor visitConditionExpression in the const evaluator.
Moved a test from `constant_test.dart` to slowly migrate it over.

Change-Id: Id7d0ef0edcfa4fced056ec8fc937b060a74f4468
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306919
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-06-06 19:30:19 +00:00