1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-05 17:30:16 +00:00
Commit Graph

101744 Commits

Author SHA1 Message Date
Kallen Tu
9ead08f053 [cfe] Local functions named _ are not in scope.
Local functions named `_` are treated the same as local wildcard variables.
They cannot be referred to.
This CL changes that behaviour.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: Idbbe2a4f5b406d4499602e808f6541af6451fb31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371480
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-14 22:31:48 +00:00
Srujan Gaddam
5ff1e59378 Add expectation tests for Function.toJS lowerings
Adds cases for 0-6 arg functions. Currently, all of these
lower to allowInterop, but will move to a arity-dependent
lowering in a future CL.

Change-Id: I6fcb3110e16b8701444ebb98496bcdb47ffb0a32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368063
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-14 22:28:40 +00:00
Kallen Tu
f141c97651 [cfe] Record type fields can be wildcards.
Positional record type fields named `_` are wildcards. They are non-binding and will not collide with other wildcard fields.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: Ic6985da5bdb32564402d084a3282fa448ff28cbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-14 22:22:39 +00:00
Kallen Tu
d15a3963e7 [cfe] Allow unnamed optional wildcard parameters to have no default value.
Wildcard optional parameters aren't used anyways, so it doesn't matter if they have a default value.
This CL removes the error that's typically there.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: Ie7286e1c3650fa347b1c28f1cc4ebd657cca33de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371560
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-14 21:30:05 +00:00
Konstantin Shcheglov
9d642f43fe Macro. Issue 55931. Failing test for adding 'extends' and then new type.
Bug: https://github.com/dart-lang/sdk/issues/55931
Change-Id: Iaf7f147b1d710d55f70ecaa2d26a8c2f88fd4afe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371781
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-14 21:11:59 +00:00
pq
2e9bd8a967 quick fixes for EXTENSION_{TYPE_}DECLARES_MEMBER_OF_OBJECT
Quick fixes for:

* `EXTENSION_DECLARES_MEMBER_OF_OBJECT`
* `EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT

See: https://github.com/dart-lang/sdk/issues/55917


Change-Id: I4a3576f7e78c58a4cf7dd6d659b576f2c7f11279
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371686
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-14 20:47:02 +00:00
Srujan Gaddam
25a9fc0aab [ddc] Move null check to JS foreign function in isDartClass and isDartFunction
The Dart != check lowers to !== in JS. The RTI property doesn't
exist in the JS function, so the result is undefined. However,
undefined !== null returns true, so JS functions are accidentally
treated as Dart functions. This fixes that.

Change-Id: I4c4e0018768c0ac29f4b5ee228c504b7cb0b7232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-06-14 20:46:20 +00:00
Parker Lougheed
2cd388617e [analyzer] Fix spelling of new workspace diagnostics
Change-Id: I94c0fce250845faf2fbc5ecb0d0865393600a636
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371503
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-06-14 20:32:27 +00:00
pq
de63980b40 quick fixes for SUBTYPE_OF_{BASE,FINAL}_IS_NOT_BASE_FINAL_OR_SEALED
Quick fixes for:

* `SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED`
* `SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED`

See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I1ee373fb030a1570f93e3a7bee694aa0ecc974f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371683
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-14 20:16:46 +00:00
Konstantin Shcheglov
8fcba75132 CQ. Use more precise source types in FileState.
Change-Id: I04bf81ec07089b09109ca91a087e5080a30ee44f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371562
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-14 19:51:38 +00:00
Sam Rawlins
3c65563735 linter: Fix issue with extension type methods as possibly const arguments
Fixes https://github.com/dart-lang/linter/issues/4978

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I532f491355bc34028b19d323102f038dff861445
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371780
Auto-Submit: Sam Rawlins <srawlins@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-06-14 19:42:24 +00:00
Srujan Gaddam
7ec9514093 [benchmarks] Add Function.toJS benchmark
Adds a benchmark to test converting Dart functions to and
from JS as well as calling them.

Specifically, tests some combinations of the following:
- Converting vs calling functions
- JS vs Dart functions
- Calling instance methods vs static methods vs closure vs
  closures stored in fields

Change-Id: I8f5b63781201042c4068437fe84c3043d6dfb446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368064
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-06-14 19:42:10 +00:00
Srujan Gaddam
06ec78851b [dart:js_interop] Add static error for converted functions that contain named params
Like type parameters, these parameters can't be passed from JS and
such functions already do not work as intended as there is no way
to pass named args to a JS function. These named parameters were
being silently ignored in dart2wasm when creating the function
trampoline.

Change-Id: Iebb890de05f8b242e0542c1ec8f2c0582c5232df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368062
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-06-14 19:42:10 +00:00
Nate Biggs
b9b4d616a4 [dart2js] Fix record field get receiver type serialization.
Internal users reported a compiler crash when using sequential compilation. Their change involved adding a class hierarchy in which the constructor of a superclass included a RecordIndexGet. When analyzing the constructor of the subclass we also analyze the body of the super constructors.

In this rare case the member being analyzed does not match the member containing the receiver node. Usually calls act as a layer of indirection that we do not analyze across.

When we then save the type of the receiver, we do so in the context of the wrong member (the subclass constructor rather than the superclass constructor). We just have to be more careful to use the correct context member.

The added test fails prior to this change.

Change-Id: I8b9a3b8a7692b8604d5c37c59b94bb8d46afff75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371580
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-06-14 19:17:14 +00:00
pq
5d3578a2a9 quick fix for WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER
(`error_fix_status.yaml` to be updated when pending quick fixes are landed.)

See: https://github.com/dart-lang/sdk/issues/55917

Change-Id: I042f6dc2171a37d008c6c2c4d1f843e0bcffc46c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371662
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-14 19:03:50 +00:00
Devon Carew
ff733cc81a [deps] rev collection, http, http_parser
Revisions updated by `dart tools/rev_sdk_deps.dart`.

collection (c90b19f..9354f38):
  9354f38  2024-06-13  Kevin Moore  Require Dart 3.4, test wasm on 3.4, prepare release (dart-lang/collection#349)

http (e2e2170..8c325b9):
  8c325b9  2024-06-14  Anikate De  pkgs/ok_http: Stream response bodies. (dart-lang/http#1233)

http_parser (53d4041..71b4c2c):
  71b4c2c  2024-06-13  Graciliano Monteiro Passos  `CaseInsensitiveMap`: added constructor `fromEntries`. (dart-lang/http_parser#99)

Change-Id: I0f848975241261f42e0759d00188fef12731a085
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371740
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-14 18:14:10 +00:00
Sam Rawlins
800d824d97 analyzer: Fix typo in property_access_test test name
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I26eef316b7bf711edb6e2e3285752244d0da2e82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371720
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Sam Rawlins <srawlins@google.com>
2024-06-14 18:04:12 +00:00
Konstantin Shcheglov
ad54e9b224 Macro. Issue 55696. If no/wrong number of type arguments, get them from actual DartType.
Bug: https://github.com/dart-lang/sdk/issues/55696
Change-Id: I6798ab5b262b6961edc2640342b9c39568cc7af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371561
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-14 17:55:29 +00:00
Keerti Parthasarathy
205ad1c492 [dart-fix] Output pubspec error code in lower case, similar to other error codes.
Fixes https://github.com/dart-lang/sdk/issues/55945

Change-Id: I3e03148222e215ea1afd53377f83e86e0983bca6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371502
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-06-14 15:52:23 +00:00
Danny Tuppeny
1b302b8df0 Move tests for switch enum cases for >= 2.19 from AddMissingEnumCaseClausesTest to AddMissingSwitchCasesTest_SwitchStatement
The tests in this class were duplicated when pattern support was added, one set
of tests for <= 2.19 and one for > 2.19. The> 2.19 tests were marked as Failing
because this functionality didn't work.

This functionality has now been implemented, but because the error code and fix
are different, these tests continued to fail. This change moves the tests to
the equivalent pattern-enabled fixes tests and removes `@FailingTest` for
those that can now pass.

There are still a few marked `@FailingTest` because of differences in the new
implementation.

See https://github.com/dart-lang/sdk/issues/52180#issuecomment-2166814402

Change-Id: Ie1dfa5bc5c608d38a191507f5f0403d20ba2ef31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371684
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-14 15:48:51 +00:00
pq
24156d0b67 [wildcards] code folding tests
Fixes: https://github.com/dart-lang/sdk/issues/56009

Change-Id: Iad1f197388d0b89e9bd9b31cc82a496cf578380b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371663
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-14 15:44:19 +00:00
Ben Konyi
fa89a0183e [ package:vm_service ] Prepare for 14.2.4 release
Change-Id: Ibee954dcbac5f7ac592686440e3d6a7fdc83b522
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371581
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-14 14:01:58 +00:00
Ömer Sinan Ağacan
76f6a32432 [dart2wasm] StringBuffer improvements
Use `U16List` instead of `Uint16List` as the character buffer type.
Access the Wasm array directly when writing characters and converting
the final buffer to a String. This avoids bounds checks and uses
`array.copy` when allocating the final string.

Change-Id: I570494e8349adc7a268544544516c9947abc8604
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-14 13:03:41 +00:00
Martin Kustermann
7078310249 [dart2wasm] Specialize string interpolation expressions for 1/2/3/4 arguments
This affects very common string interpolation expressions where we now
avoid creating arrays and looping over arrays and casting references
when getting things out of arrays.

e.g. `StringBuffer.write()` uses "$obj" in it's implementation
which will benefit from this.

Change-Id: Ie6615e5f76a4a8ccb4ff9aa85c05c7e39eab6f00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371660
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-14 12:33:51 +00:00
Johnni Winther
4b704b8f0b [cfe] Use SourceCompilationUnit in SourceLoader.tokenize
This moves a lot of the methods needed for tokenization and
outline parsing from SourceLibraryBuilder to SourceCompilationUnitImpl.

Parts that are still used elsewhere remains in SourceLibraryBuilder
but accessed through SourceCompilationUnitImpl.

Change-Id: I0df431eee4c187e5447850961d2c27be14cb0ba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371682
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-14 10:49:48 +00:00
Martin Kustermann
689852e3f0 [dart2wasm] Fix new web/wasm/allow_import_export_pragmas_test test: Add --extra-compiler-option= before the flag name
This wasn't caught by default CI builders, because
default configurations use `pkg/dart2wasm/tool/compile_benchmark`
which passes all unknown flags to the compiler (for convenience
of local development) but `dart compile wasm` doesn't

Change-Id: I6a92d3f04848e027c92b1feee3d54e7efba9fd27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371661
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2024-06-14 10:18:23 +00:00
Sergey G. Grekhov
094f43b22c [co19] Roll co19 to 831b22d5e496fe63a813ca1c1b64f533c2f9fa0c
2024-06-13 sgrekhov22@gmail.com dart-lang/co19#2694. Add more checks for use of `?e` in an expression (dart-lang/co19#2713)
2024-06-13 sgrekhov22@gmail.com dart-lang/co19#2694. Add more null-aware elements syntax tests (dart-lang/co19#2706)
2024-06-13 sgrekhov22@gmail.com dart-lang/co19#2694. Add unnecessary null-aware elements tests (dart-lang/co19#2701)
2024-06-13 sgrekhov22@gmail.com dart-lang/co19#2694. Add constants and runtime semantics tests (dart-lang/co19#2700)
2024-06-13 sgrekhov22@gmail.com dart-lang/co19#2694. Add type inference tests for sets (dart-lang/co19#2697)
2024-06-12 sgrekhov22@gmail.com Fixes dart-lang/co19#2709. Remove outdated error expectation from redirecting_constructor_t03.dart (dart-lang/co19#2710)
2024-06-12 sgrekhov22@gmail.com Fixes dart-lang/co19#2707. Add more `call` member tests (dart-lang/co19#2708)
2024-06-12 sgrekhov22@gmail.com dart-lang/co19#2694. Add the first bunch of null-aware elements tests (dart-lang/co19#2696)

Change-Id: I026509d924976da91294d4d904f03a5d8027115b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371640
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-06-14 10:10:26 +00:00
Johnni Winther
289bba506e [cfe] Remove LibraryBuilder.nullableBuilder et al.
Change-Id: I36b2a8c25568d4df90a6a1b039d15519d244be96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371123
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-14 10:10:20 +00:00
Ömer Sinan Ağacan
b807dbd0cd [third_party] Add jsshell binaries to gitignore
Ignore files downloaded with the gclient custom var
"checkout_javascript_engines":

- third_party/firefox_jsshell/js
- third_party/firefox_jsshell/libnspr4.so
- third_party/firefox_jsshell/libplc4.so
- third_party/firefox_jsshell/libplds4.so

Change-Id: I135126867994862b48185ec9fa6be71e113411d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371680
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-14 09:33:07 +00:00
Johnni Winther
74d2eb28a6 [cfe] Add DillCompilationUnit and SourceCompilationUnit
This adds DillCompilationUnit and SourceCompilationUnit and separates
CompilationUnit from DillLibraryBuilder and SourceLibraryBuilder.

This prepares for creating SourceLibraryBuilders only after
CompilationUnits have been resolved into parts and main libraries.

Change-Id: I1b8e77ac66648f7d12ee7f09826d305fdfccb363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371300
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-14 08:47:46 +00:00
Ömer Sinan Ağacan
060d841ec0 [vm] Improve JSON copyCharsToList argument type
The buffer type is always `Uint8List`, improve the type from `List<int>`
to `Uint8List`.

Tested: existing tests
Change-Id: I03ad84a0f1fe1ade8a46719545f3c33eeccd99b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371402
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-14 08:31:19 +00:00
なつき
bde8d28217 Fix build regression on alpine linux
Closes https://github.com/dart-lang/sdk/pull/55993

GitOrigin-RevId: 0a4d00914442f6be1bce949ca7a234fbd04952cd
Change-Id: I1cb1ad381111853c03ac3a39854a0c0a75a3d31a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371262
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-06-14 07:39:30 +00:00
Daco Harkes
47cb48e415 [vm] Native asset relative path resolution with symlinks - fix
The fallback mechanism wasn't working because the embedded struct by
value wasn't nullptr initialized.

TEST=tested by commenting out `Dart_InitializeNativeAssetsResolver`
in `main_impl.cc`. Without this CL it segfaults, with this CL it works
as expected.

Closes: https://github.com/dart-lang/sdk/issues/56006
Change-Id: If93cf9b077a2791a8385bdc8e75708dd95c8ead6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371620
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-14 07:05:15 +00:00
Martin Kustermann
6f21d19b02 [dart2wasm] Add flag to allow experimental wasm interop.
Adds a flag users can use via

    dart compile wasm \
        --extra-compiler-option=--enable-experimental-wasm-interop

which allows code to import `dart:_wasm` and use import/export
pragmas.

Similar to how we have a way to import `dart:ffi`

    dart compile wasm \
        --extra-compiler-option=--enable-experimental-ffi

TEST=web/wasm/allow_import_export_pragmas_test (positive test)
TEST=web/wasm/reject_import_export_pragmas_test (negative test)

Change-Id: Ibdbbac6c3aa049b2759e96b7b749dd30ecc6aaed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370063
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jackson Gardner <jacksongardner@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-06-14 07:01:58 +00:00
Alexander Thomas
ff3f629d4b [3xH] Migrate apply.sh to python 3.12
See https://docs.python.org/dev/whatsnew/3.12.html#imp

Fixes: https://github.com/dart-lang/sdk/issues/55973
Change-Id: I0ac6e60104bddc17cfe5cd537a409c4ded3eb1a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371302
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-06-14 06:52:12 +00:00
Martin Kustermann
18ffc284c3 [dart2wasm] Remove deprecated --name-section flag from dart compile wasm
Change-Id: I1e1746c408a704d23db1dbf05b554afda667a0ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371540
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
2024-06-14 06:50:18 +00:00
Sam Rawlins
50e4c576b9 analyzer: fix various issues for static extension member resolution
* Unqualified, out-of-scope static extension members are not
  accessible.
* Locally scoped extension members shadow others.
* Static and instance extension members do not conflict.

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

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

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Icd618d044b3857efa24f365c6835d42c0022c176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370323
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-06-14 00:59:57 +00:00
Konstantin Shcheglov
b4e30d1b45 CQ. Deprecate unused static members of AnalysisError.
Change-Id: I46e76defbc9a833a867cc3fa2154635f71a6d085
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371422
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 23:39:21 +00:00
Mayank Patke
bf83cc30ed [dart2js] Convert VariableUse to a sealed class hierarchy.
Change-Id: I28d71d81031e3e6eefc2b4f6decfe375099a1c32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371185
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-06-13 23:01:34 +00:00
Stephen Adams
18994e6e46 [typed_data] Remove UnmodifiableXXXView classes
In most cases, the (now removed) SDK class was patched so that the constructor redirected to a platform-specific implementation of the unmodifiable view. Uses of the SDK class in the platform code could be rewritten to the more direct use of the implementation class.

The big +/- file changes are from moving the implementation classes from the patch file (typed_data_patch.dart), where they are no longer needed, to the internal file (typed_data.dart).

TEST=ci
Bug: #53785
Change-Id: Iaa7370de25b7fc2d26b24f7733c2892868e593cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370661
Reviewed-by: Ömer Ağacan <omersa@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2024-06-13 22:18:29 +00:00
Konstantin Shcheglov
7ae9900059 CQ. Deprecate File.createSource()
Change-Id: I222989d1ef915f7f14d7a3f36eab614a163faec3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371501
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 21:11:39 +00:00
Ben Konyi
9304826679 [ DDS ] Refactor DDS entrypoint to allow for overriding behavior in google3
This moves the CLI logic into lib/src/dds_cli_entrypoint.dart so it can
be invoked by a custom google3 entrypoint (bin/dds.dart can't be
imported using a package: URI).

Since google3 will be able to perform some custom configuration of DDS,
google3 related logic (e.g., `BazelUriConverter`) is also removed. This
is technically a breaking change, but should be safe as this
functionality isn't currently being used.

Change-Id: I54d8a9927ff2df70e013ca5c8bc1d510b0b95f02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371520
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-06-13 20:27:22 +00:00
Konstantin Shcheglov
02faed0a9a Prepare to publish analyzer 6.6.0 and _fe_analyzer_shared 71.0.0
Bug: https://github.com/dart-lang/sdk/issues/55870
Change-Id: Ic06f4c0a2cc5dc5f07f72335dd172f203b948cb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-13 19:56:30 +00:00
Mayank Patke
0ddba91190 [dart2js] Convert SubclassResult to a sealed class hierarchy.
Change-Id: I151c2f6f72dcecaff6a6976f058940b9ddf97f47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371461
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2024-06-13 19:25:28 +00:00
Konstantin Shcheglov
cc073a0782 Macro. Re-export package:_macros/src/executor/response_impls.dart from 'package:macros'.
Change-Id: I89e59cbac52edb5197e409e3000c5a3dedd80b3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371421
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-06-13 19:12:41 +00:00
Ömer Sinan Ağacan
1ec4677870 [dart2wasm] More JSON decoding improvements
- Use unchecked reads when reading from `U8List` chunks.

- Use unchecked reads when reading from "transition table" in UTF16 decoder.

- Fix a typo in a comment.

Tested: performance refactoring, covered by existing tests.
Change-Id: I1b90781f2b419188d6a560994159b48faad16075
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371301
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-06-13 18:49:18 +00:00
Konstantin Shcheglov
9974252ac6 Increment DATA_VERSION.
https://dart-review.googlesource.com/c/sdk/+/371260 should have done this.

Change-Id: I34763f6221ad1c0f098d1c24eb9928935f917c78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371442
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-06-13 18:48:25 +00:00
Danny Tuppeny
bf7f5171e5 [analysis_server] Treat field formal parameters and fields equally when finding references in LSP
This changes LSP's Find References to treat fields and field formal parameters as a single entity (matching what Document Highlights (Occurences) and Rename refactor does).

It does this in one direction by resolving the initial element to a field if it's a FieldFormalParameter, and in the other by including FieldFormalParameters when collecting the set of elements in the hierarchy to find references to.

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

Change-Id: I33626a8d58f35d0c3bda574078f32bf98f4bc87c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-13 18:34:33 +00:00
Keerti Parthasarathy
95f90f553f Remove unused code in test method.
Change-Id: I541762501e9546eaaf0f1022ebdebbeefe6413dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371460
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-13 18:30:10 +00:00
Mayank Patke
ad3a1a72fd [dart2js] Convert IsTestSpecialization to sealed class hierarchy.
Change-Id: I08552d4dda928259be56e0b99f9f002baeb4d6b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371240
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2024-06-13 18:21:59 +00:00