Commit graph

47726 commits

Author SHA1 Message Date
Mayank Patke d430e7ab55 [dart2js] Remove memberContext from getConstantValue.
Change-Id: I3ed4343c7cd2880414a8e99361d8017ca9f756a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372160
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2024-06-18 18:31:58 +00:00
Sam Rawlins 4f5dc5603f analyzer: Deprecate dead properties on Comment
Work towards https://github.com/dart-lang/sdk/issues/56038

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: If7ae2738fec598f16756c524b6bd6c258ee5609e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-18 18:27:25 +00:00
Kallen Tu 48cadec309 [cfe] Top level function wildcard parameters are non-binding.
This CL prevents function wildcard parameter collisions and avoids adding function wildcard parameters to scope.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I5a8b85ceef15b355f6a36a1d1d19df038980331d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-18 18:23:55 +00:00
Konstantin Shcheglov ddce8d50c4 Macro. Add more details for performance.
Bug: https://github.com/dart-lang/sdk/issues/55784
Change-Id: I2e633eae9f28a6ed053eca762068e8fac7e56c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372121
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-18 18:19:22 +00:00
Sam Rawlins 88e62a23cf Expose CommentToken as analyzer public API
CommentToken is the static type of `Token.precedingComments`:
https://pub.dev/documentation/analyzer/5.13.0/dart_ast_token/Token/precedingComments.html
and so should be exposed as public API.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I06e3e897bf310b9bc0e5067ab0f44db3a3e459c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371946
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-18 17:34:27 +00:00
Danny Tuppeny c001d5116a [analyzer] Prioritize errors in analysis_options/pubspec errors when running "dart analyze"
This changes the (non-machine/json) output of "dart analyze" when there are errors in pubspec.yaml/analysis_options.

Before:

```
Analyzing myapp...

  error • analysis_options.yaml:3:1 • Expected ':'. Parse errors in analysis_options.yaml may result in other incorrect diagnostics. • parse_error
  error • lib\main.dart:1:16 • A value of type 'Null' can't be returned from the function 'foo' because it has a return type of 'int'. • return_of_invalid_type

2 issues found.
```

After:

```
Analyzing myapp...

Errors were found in pubspec.yaml or analysis_options.yaml which may result in other incorrect errors.

  error • analysis_options.yaml:3:1 • Expected ':'. Parse errors in analysis_options.yaml may result in other incorrect diagnostics. • parse_error

Errors in other files that might be caused by those above.

  error • lib\main.dart:1:16 • A value of type 'Null' can't be returned from the function 'foo' because it has a return type of 'int'. • return_of_invalid_type

2 issues found.
```

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

Change-Id: I25ae7b200463f2cd3f2046ea9f5f8ddc5c62cc60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372080
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-18 17:29:16 +00:00
Alexander Markov 0c9067c626 [vm,aot] Preliminary support for dynamic interface in AOT
TEST=runtime/tests/vm/dart/dynamic_module_pragmas_il_test.dart

Change-Id: I6efd24f55726db858711d5f77beabf5659e288a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371563
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-18 14:31:24 +00:00
Brian Wilkerson 1e5f96514c Remove type cast in completion to prevent exception
Change-Id: If97adc54523894a3b9df241ffb0308ee1299d03d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372020
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-18 14:14:19 +00:00
Danny Tuppeny d4c2b91a14 [analyzer]/[analysis_server] Handle parse errors in analysis_options.yaml better + tweak unhandled exception text
Fixes the main issues at https://github.com/dart-lang/sdk/issues/55987

Change-Id: I5b86f7c0df4017c02b96e67d8d8d03b71933b318
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371861
Reviewed-by: Sam Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 23:15:51 +00:00
Stephen Adams 3a91bcb39e [dart2js] SSA - pre-assign variable to reduce phi assignments
Introducing a partial redundancy with a variable with a longer
live-range can reduce the size of the emitted code.

Flute.complex (-O4): -0.377%
cm_shell (-O4): -0.029%

Change-Id: I0d03119b17f4b58d61f277bf8bb0e57d8e7c47c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360360
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-06-17 22:47:57 +00:00
Kallen Tu 3d42eb5308 [cfe] Change wildcard tests to not use main().
Change main() to test() so we don't need an entry in the status file.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I41e6a70ce486279389e4d613f52e9ceb62c8e792
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371783
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-17 20:22:46 +00:00
Stephen Adams 77496338dc [dart2js] Constant-fold const record accesses
I noticed that dart2js generated poor code for `(a, b) = (1, 2)`.
This is due to an oversight in not constant-folding record field loads.

Change-Id: Iac110d8c3373d7673c21494fc467f7fcb400de1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-06-17 19:47:34 +00:00
Sam Rawlins 8c918ffda3 analyzer: Fix resolution of private extension members
Fixes https://github.com/dart-lang/sdk/issues/45240

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Idc054d968c5884dcf6bc876d996c741e8300cab0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-17 18:28:21 +00:00
Brian Wilkerson dc5954c394 Improve the wording of an error message
Fixes: #43180
Change-Id: Ib8b17e156b81811af4144b54a483f43db1e84771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371741
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 15:31:03 +00:00
Brian Wilkerson a01d45ce82 Improve highlight range for some ffi diagnostics
Fixes: #54181
Change-Id: Ia1e3f5e121fc961bb8cf34cf83827125f4a3e5a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371782
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 15:25:06 +00:00
Parker Lougheed 041d4ffd6a [analysis_server] Disallow construction/extension of namespaced enumerations
Change-Id: Ic4279ed0c29649b7ad7ece1e190606fe04f2778f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 15:23:00 +00:00
Danny Tuppeny d209ea9333 [dtd] Allow passing an explicit port to DTD
Removes the port from `startService()` (which as far as I can see is unused) and parses it from `args` instead.

I had to add support for "options" in the argument classes and switched from a bool flag `isFlag` to an enum to be a bit more descriptive (and be easier to support multi-options in future if required).

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

Change-Id: Ib08513139f58e8845a7c2cbbeeea06787dbc2df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371840
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-06-17 14:58:19 +00:00
Parker Lougheed 91254e4064 [analyzer/linter] Surface links to available lint diagnostic messages
Dependent on https://github.com/dart-lang/site-www/pull/5914 landing first.

Bug: https://github.com/dart-lang/site-www/issues/4498
Change-Id: I378debd5d484e17f18d59c49173a5d010f05b6df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371785
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
2024-06-17 14:51:31 +00:00
Ben Konyi 56416078a0 [ DDS ] Remove extra stderr.close()
Change-Id: Ice61586e2a60d039987b1e3b5f5f328cc46fb41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371880
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2024-06-17 14:44:22 +00:00
Johnni Winther 194f076bd5 [cfe] Process imports/exports separately
Since the addition of the OffsetMap, imports and exports no longer
need to be processed by offsets, simplifying their handling.

Change-Id: I98698bf1d8f287046147d2f8ebfb005c5fae4d0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371403
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-17 12:43:51 +00:00
Jens Johansen b28b49b537 [CFE] Update coverage expect file after VM coverage fix
After VM fix (856139bfc3) the coverage
should be stable.
This CL updates the coverage "expect" file.

Change-Id: Icfcb4e0869ea97232b985f985a79754da3832ebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371820
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-17 11:50:39 +00:00
Jens Johansen 856139bfc3 [VM] Add RecordCoverage to InstanceCall and StaticCall
Before this CL, becase of optimizations, coverage of some of these goes
away, making coverage unreliable.

I believe this fixes the issues for "regular" runs (at least it seems to
be stable on the CFE coverage tests).

If setting `--optimization-counter-threshold=-1` there'll still be
trouble though and we would have to also insert these calls in the start
of FunctionBody and the start of FieldInitializer for it to produce the
same results.

TEST=pkg/vm_service/test/coverage_instance_call_after_optimization_test.dart,pkg/vm_service/test/coverage_static_call_after_optimization_test.dart

Bug: https://github.com/dart-lang/sdk/issues/42061
Bug: https://github.com/dart-lang/sdk/issues/55959
Bug: https://github.com/dart-lang/sdk/issues/56018

Change-Id: I34947f0d4b123e52ce67b71a195782d31e4bda16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370501
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-06-17 10:47:58 +00:00
Johnni Winther 47a69d9db6 [cfe] Move SourceLibraryBuilder.parts to SourceCompilationUnitImpl
Change-Id: Id3f4ec4bb107169c8a95b9cc6b8bf8032545c360
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371687
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-17 08:26:10 +00:00
Konstantin Shcheglov 51ecf21356 Prepare to publish analyzer 6.7.0 and _fe_analyzer_shared 72.0.0
Change-Id: Idfac92660bac987a6e0576ef6418a5eadee3a98a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-16 17:51:49 +00:00
Keerti Parthasarathy 627cd3047d Hide nonVirtual elements in override completions.
Fixes https://github.com/dart-lang/sdk/issues/55628

Change-Id: I70dcf5b47dae2faef30a47a4e3f811e735a1eeec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371742
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-06-14 23:45:19 +00:00
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
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 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
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
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
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
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
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
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