Commit Graph

104323 Commits

Author SHA1 Message Date
pq 107995fcdb [diagnostics] use_build_context_synchronously message fix
Picking up abandoned change: https://dart-review.googlesource.com/c/sdk/+/395461

Change-Id: Id5a876dec73870bb379e9ad89226669272ebf673
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396382
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
2024-11-19 22:12:43 +00:00
Konstantin Shcheglov c69d32577f Elements. Migrate AstDataExtractor and _InheritanceDataComputer.
Also add `Element2.lookupName`, because of `unary-`.

Change-Id: If69cf9b512ccf3f8274cb18106a1fa50557c7afa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-19 21:46:02 +00:00
Devon Carew 4b39eefe48 [infra] minor updates to the github issue templates
Change-Id: Ibce8c4adfb2bb2bd51b92fb9e16c377a9129c6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396384
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2024-11-19 21:42:11 +00:00
Ivan Inozemtsev 242406b2b4 Fix toolchain_cpu for clang_arm64 android toolchain
That's the only mention of `aarch64` in a context of cpus:
https://github.com/search?q=repo%3Adart-lang%2Fsdk%20path%3A*.gn*%20aarch64&type=code.

Similar to https://dart-review.googlesource.com/c/sdk/+/395300, I
believe it works correctly now only by accident, because `current_cpu`
defaults to `target_cpu`, and `toolchain_cpu` is unused.

However when using mulitple toolchains, `current_cpu` is set to
`toolchain_cpu`, and config evaluation fails at
https://github.com/dart-lang/sdk/blob/246050a1ef6233d9574ce6a30d30506e004fef3d/build/config/android/config.gni#L107

Change-Id: Ic3b3ab4afecf00556f0420800f058ebe4c64fa70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396260
Auto-Submit: Ivan Inozemtsev <iinozemtsev@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-11-19 20:47:10 +00:00
Devon Carew d8cd8cddcf [deps] rev dartdoc, http, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/6bbd3d7..f8a55e4):
  f8a55e4b  2024-11-18  Parker Lougheed  Remove unused build config (dart-lang/dartdoc#3923)
  fa339a10  2024-11-15  Sam Rawlins  Refactor how Object and Pragma are discovered and handled (dart-lang/dartdoc#3929)

http (https://github.com/dart-lang/http/compare/2f954e1..e37093f):
  e37093f  2024-11-15  Brian Quinlan  Upgrade to `package:`objective_c` 4.0 (dart-lang/http#1406)
  e509abb  2024-11-14  Slava Egorov  Switch browser_client.dart to use fetch (dart-lang/http#1401)

yaml_edit (https://github.com/dart-lang/yaml_edit/compare/3d1421b..8bd0fdf):
  8bd0fdf  2024-11-18  Kevin Moore  Fix unused param in a private ctor lint (dart-lang/yaml_edit#99)

Change-Id: I12a74dc3bce629c213d26fbb6e76fc3c19a443dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-11-19 20:43:02 +00:00
Devon Carew a60aa7a511 [infra] update the list of github issue templates
Change-Id: I3df8f3f7c2f30ede926ee248fe3448372ef6ca0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396421
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-11-19 19:40:45 +00:00
Konstantin Shcheglov 156ff660f6 Elements. Migrate FindElement2.
Change-Id: Ia5b901fbe8a7666a829628dcf9056c35e99f20bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396460
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-19 19:09:03 +00:00
Kallen Tu dcee4f2d4d [tests] Enum shorthand language tests - simple identifier and == only.
This CL adds language tests for the simple identifier variation of enum shorthands. In these tests, we are testing prefix identifiers with a single simple identifier.

For example, `Decoration(fit: BoxFit.cover)` where `fit` has the type `BoxFit?`, we would be able to turn this into `Decoration(fit: .cover)` with enum shorthands.

The tests also test erroneous ways that someone can use the `==` operator like the shorthand not being on the RHS.

Bug: https://github.com/dart-lang/sdk/issues/57038
Change-Id: I03610db2a683e9c2cdf8c12a99c7808171377e3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393606
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-11-19 18:52:33 +00:00
Konstantin Shcheglov ff956dc031 Elements. Migrate many analyzer resolution tests.
Change-Id: Ied261a783756c5954d4363c4298201b8fc25e560
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396381
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-19 18:52:30 +00:00
Keerti Parthasarathy c7d0e325d7 [Elements.migrate] Migrate CandidateSuggestion.
Change-Id: I664ab34e7c674582d98f3c75d3fffe41d8cf8be5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-11-19 18:14:27 +00:00
Danny Tuppeny d38e0ff148 [analysis_server] Migrate LSP "Go to Type Definition" to new element model
Change-Id: I4de207adc9301b2533885d51329ccc0b6600b86d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-19 18:07:04 +00:00
Paul Berry 0ebb4fe7d9 Sort declarations in shared_type.dart
Change-Id: Id75cbcb1f49dc21db6ad8536214dec7bd757d55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396301
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-19 17:56:22 +00:00
Ryan Macnak 4924cf9dab [vm] Fill in ELF attributes for RISC-V.
TEST=readelf
Change-Id: Ida1069f12998c8d12750d23843a7f964bf618077
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396100
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-11-19 17:49:09 +00:00
Paul Berry ac6d86c737 [analyzer] Represent Null as NullTypeImpl.
This change introduces the class `NullTypeImpl` to represent the
special type `Null`, which was previously represented as an ordinary
`InterfaceType`.

This class mirrors the CFE's `NullType` class. Adding it will
facilitate further code sharing between the analyzer and the CFE,
because it will allow code that's shared between the analyzer and CFE
to use `is` tests to recognize the type `Null`.

The new `NullTypeImpl` class always has a nullability suffix of
`NullabilitySuffix.none`, so it is impossible for the type `Null?` to
occur. This is a benign behavioral change; previously there were some
circumstances in which the type `Null?` might occur in the analyzer,
but the type `Null?` behaved the same as `Null` so there was no
user-visible effect. This behavioral change brings the analyzer's
treatment of `Null` into alignment with that of the CFE.

This is the first step in a planned patch series. In follow-up CLs, I
intend to:

- Introduce a public-facing `NullType` for use by clients.

- Change `NullTypeImpl` so that it no longer extends `InterfaceTypeImpl`.

- Add a base class that is common to the analyzer and CFE `NullType`
  representations.

Change-Id: I9cea84d8149347bffdee006d544af28c66eba429
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396320
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-19 17:17:18 +00:00
Chloe Stefantsova d79fcdf4cd [analyzer][cfe] Remove unnecessary use of shared views
This CL removes the unnecessary conversion from `TypeStructure` types
to `SharedTypeView` and `SharedTypeSchemaView` and back. By design,
the shared constraint generation method is operating on
`TypeStructure` types and uses the shared procedures named with the
'Internal' suffix to transform those types. In this CL the shared
procedures that are only used in the shared constraint generation
method or in 'Internal' procedures are converted to 'Internal'
themselves, and the corresponding update in the parameters accepted
and returned by those procedures is made.

Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Ic8596b342bde7e78093e990fc0f12f705ff6dee1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395962
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-11-19 17:17:13 +00:00
Ryan Macnak 651bde574b [vm, compiler] Implement MathMinMaxInstr with min/max when available.
TEST=vm/dart/min_max_test
Change-Id: I727a421d8c38261effdf3b09dbd4fd9330693f82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-11-19 17:08:28 +00:00
Paul Berry 5ec81d0801 [mini_types] Add support for type parameters of function types with bounds.
This required improving the implementation of `operator == ` for
function types, to check that the bounds match (after performing
appropriate substitutions). It also required modifiying
`FunctionType.substitute` to apply the substitution to the bounds.

The API for `TypeParameter` was changed slightly, so that it's
possible to distinguish between an explicit bound of `Object?` an an
implicit one. This allows `FunctionType.toString()` to avoid
outputting `extends Object?` next to a type parameter that has an
implicit bound.

Change-Id: Iad31a44a1f87ca0cd830b8c802495b7ce2c1caab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396141
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-11-19 16:52:40 +00:00
FMorschel 6dac184012 Adds library result
R=scheglov@google.com

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

Change-Id: I125c53e138c97e57fc22d69b2362351ddcbb6b4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395420
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <fmorschel.dev@gmail.com>
2024-11-19 15:50:42 +00:00
Alexander Markov 6e54ea62f4 [vm/compiler] Merge shift instructions to binary instructions
Uint32 shift changed from (uint32, int64) -> uint32 to
(uint32, uint32) -> uint32.

TEST=ci

Change-Id: Ife1307af72a7c24dd8bd1fa00e90c8e7b903a405
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396043
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-11-19 14:06:00 +00:00
Robert Nystrom 246050a1ef Opt multitests out of formatting in corelib/ and lib/.
The new formatter supports opting a region of code out from being
formatted. I'm applying this marker to all of the multitests since
those tests are often very sensitive to formatting and easily broken.
This way, anyone touching a multitest (including me when I reformat
the tests) doesn't have to remember to not run the formatter on it.

Change-Id: I34831719cd35e669b49e02a0d00c32b44068a34e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396103
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2024-11-19 11:14:40 +00:00
Ömer Sinan Ağacan 3140b09545 [dart2wasm] Name globals and functions for static fields
Adds new names:

- Globals for static field initialization flags are named as
  "$memberName initialized".

- Globals for static field values are named as "$memberName".

- Static field initialization functions are named as "$memberName
  initializer".

Also documents fields of `Globals` and removes unused field
`_globalInitializers`.

Change-Id: Id54c6e679b2d028917e86184e2913bb51e6b5a97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396240
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-11-19 11:13:22 +00:00
Chloe Stefantsova e2c17b938f Enable 'inference-using-bounds' flag in 3.7
TEST=existing

Change-Id: If7f143ab6c60cfda962c1ceba78fdbfdd949a3cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-19 08:54:03 +00:00
Robert Nystrom baa171d19e Opt multitests out of formatting in ffi/.
The new formatter supports opting a region of code out from being
formatted. I'm applying this marker to all of the multitests since
those tests are often very sensitive to formatting and easily broken.
This way, anyone touching a multitest (including me when I reformat
the tests) doesn't have to remember to not run the formatter on it.

Change-Id: Idb467e105e7ca67c8473c1ee2d2549f7c628661f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396180
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-11-19 07:43:30 +00:00
Stephen Adams 23a98d808c [vm, wasm] Separate Iterables for _Map.{keys,values,entries}
The Iterables have been separated and specialized.

The `keys` Iterable specialized so that the `contains` method uses the Map's `containsKey` method. This is required for correctness and usually much faster that the linear scan of `Iterable.contains`.

The default `MapBase.entries` maps over the keys and does lookups. It is faster to scan the data like `get keys` and `get values`.

Issue: #52909

Change-Id: Id3400c3efd8e657c74b41b3fce71e0713dc790bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389266
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-11-19 03:06:10 +00:00
Konstantin Shcheglov 7f31e316d4 Elements. Migrate many analyzer resolution and diagnostics tests.
Change-Id: I28af838697c4956c0df02d860f616f694d9b982e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396200
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-19 02:16:59 +00:00
Brian Wilkerson 779a433d55 Migrate four computer classes
Change-Id: I9d5a9cd8c85ef703938aecb4e233467917f73aac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396101
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-19 01:05:45 +00:00
Robert Nystrom d7ed15658a Opt multitests out of formatting in web/.
The new formatter supports opting a region of code out from being
formatted. I'm applying this marker to all of the multitests since
those tests are often very sensitive to formatting and easily broken.
This way, anyone touching a multitest (including me when I reformat
the tests) doesn't have to remember to not run the formatter on it.

Change-Id: I3d6346d31581772dc8e1701594bf9d919f28db7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396104
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2024-11-19 00:59:10 +00:00
Robert Nystrom 6129842d74 Opt multitests out of formatting in standalone/.
The new formatter supports opting a region of code out from being
formatted. I'm applying this marker to all of the multitests since
those tests are often very sensitive to formatting and easily broken.
This way, anyone touching a multitest (including me when I reformat
the tests) doesn't have to remember to not run the formatter on it.

Change-Id: I06928e08530ad658affd23e594702cff658d8035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396181
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2024-11-19 00:57:42 +00:00
Keerti Parthasarathy ad8c44f3d9 [Elements.migrate] Migrate LibraryElementSuggestionBuilder
Change-Id: I56dde963754fbaf5012f7229fa5a37441c210c4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-11-18 23:47:10 +00:00
Brian Wilkerson 478aba8bf2 Migrate flutter support
Change-Id: I52899ecc30b2db3e4990df523c2b0bbd19d46e95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395704
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-18 22:39:18 +00:00
Stephen Adams d2c9d936a7 [benchmarks] Add MultipleReturns to Omnibus
Change-Id: I891fcca4295e244982aae470cb19473ae1349483
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396160
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-11-18 22:02:17 +00:00
Siva Annamalai cc46252520 Revert "[SDK] Remove build rule for dart_precompiled_runtime"
This reverts commit c65057eda0.

Reason for revert: golem build breakage

Original change's description:
> [SDK] Remove build rule for dart_precompiled_runtime
>
> TEST=ci
>
> Change-Id: I2fa2de462a9170941ed9201ba14182d490de65cb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395683
> Reviewed-by: Alexander Aprelev <aam@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

Change-Id: Iba090f1c62468d2cdbce51f9fbfc5102fc4d37d6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396161
Auto-Submit: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2024-11-18 21:40:36 +00:00
Jessy Yameogo 9e0f1840c3 Allow test to handle both RPCErrorKind.kConnectionDisposed and kServerError codes. These codes can be thrown if the VM shuts down before the service can send its response
Fixes https://github.com/dart-lang/sdk/issues/56909

Change-Id: I8a0a9328f2342811a6c230712c8b908bbd7d828c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396120
Auto-Submit: Jessy Yameogo <yjessy@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-11-18 20:45:45 +00:00
Nate Biggs 6e8180a40b [dart2js] Fix timing issue in protobuf conditional impact enqueueing.
Prior to this fix, the "processedMembers" field on the ResolutionWorldBuilder was getting used as the signal that a member was active and therefore any conditional uses dependent on it should be active.

In some cases the following would occur:
1) The listener gets a signal a member is active. It checks if there are any conditional uses for that member and sees none.
2) A conditional use is registered and the member is not indicated as active yet so the use is stored as pending in ResolutionEnqueuerListener.
3) "processedMembers" in ResolutionWorldBuilder is updated for a member that would mark the conditional use active. This doesn't trigger a check of the pending conditional uses.

If the enqueues happen in this order (which is not always the case), the  conditional impact will not be marked active and the field will be erroneously tree shaken.

The solution here is to remove step 3 and add an analogous "usedMembers" update in step 1. Step 1 will always occur before step 2 so the conditional impact ledger and the usedMembers ledger will always stay in sync.

Change-Id: Ib732a4fe5dcc8fc7cbe9a6d37e1c239e287595ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395740
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-11-18 20:37:44 +00:00
Paul Berry 6f4cf5631a [mini_types] Add support for generic function types.
Generic function types have the following special behaviors:

- Their implementations of `hashCode` and `==` take care to ensure
  that if two generic types differ only in the names of their type
  parameters (i.e. they are alpha-equivalent), they will compare equal
  and have the same hash code. For example, `T Function<T>()` and `U
  Function<U>()` represent the same type. This logic takes advantage
  of `Type.substitute` and `Type.gatherUsedIdentifiers`, added in
  recent CLs.

- When parsing a generic function type, references to type formals can
  appear in the return type or parameter types. E.g. in the function
  type `T Function<T>()`, the return type `T` refers to the type
  formal `T` declared by the function type. It doesn't refer to a `T`
  declared elsewhere. To make this possible, the parameter
  `typeFormalScope` has been added to `Type.materialize`; this carries
  the meaning of type formals through the recursive process of
  transforming a `_PreType` into a corresponding `Type`.

In a follow-up CL, I will use this new support to unit test the
generic function type logic that's recently been added to
`TypeConstraintGenerator` (see
https://dart-review.googlesource.com/c/sdk/+/393860).

Change-Id: Ib5e392f844990185b2602d22809eac5599505aff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395687
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-11-18 20:23:20 +00:00
Sam Rawlins e5274a522e DAS: Use new package:args API for less casting
Change-Id: Ib0fbdebb6c703202f13330d7bf53eade26fa73de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396040
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-11-18 19:34:39 +00:00
Danny Tuppeny be7a40dd78 [analyzer] Ensure parseFileSync() flushes pending file changes
Fixes https://github.com/dart-lang/sdk/issues/57120
Fixes https://github.com/dart-lang/dart-pad/issues/3092

Change-Id: I803cdc19702bcd357cdafde3176ecad246495182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-11-18 19:05:29 +00:00
Paul Berry 2a4ce143f3 [mini_types] Introduce _PreType class hierarchy.
The `_PreType` class (and its subclasses) mirrors the `Type` class,
except that it represents types in a more raw form, before identifiers
have been resolved to their associated meanings. For example, the
`_PreType` representing `int` is a `_PrePrimaryType` whose `typeName`
field is the string `int`, whereas the `Type` representing `int` is a
`PrimaryType` whose `nameInfo` field points to the `TypeNameInfo`
object representing the class `int`.

Parsing of `Type` objects is now a two-step process: the string is
first converted to a `_PreType`, and then the `_PreType` is
materialized into a `Type` by looking up each identifier in it in the
`TypeRegistry`.

This will be needed in a follow-up CL that introduces support for
generic function types, to support the possiblity that a generic
function type's return type refers to one of its type parameters
(e.g. `List<T> Function<T>()`). The reason this is will be needed is
because the meaning of the return type (`List<T>`) can't be determined
until the `TypeParameter` object representing the type parameter `T`
has been created.

Change-Id: I9f4a73bdc0f38380518a9c39db8c788234adb806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395686
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-11-18 19:05:17 +00:00
asiva c65057eda0 [SDK] Remove build rule for dart_precompiled_runtime
TEST=ci

Change-Id: I2fa2de462a9170941ed9201ba14182d490de65cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395683
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-11-18 18:33:17 +00:00
Paul Berry ae0b50d62b [mini_types] Add a Type.gatherUsedIdentifiers method.
This method will be used by a follow-up CL that adds support for
generic functions, since the implementation of `==` and `hashCode` for
generic functions needs to perform substitutions in order to recognize
that alpha-equivalent types (such as `T Function<T>()` and `U
Function<U>`) are equal, and those substitutions need to avoid name
collisions with identifier names that already appear in the type.

Change-Id: Ifd237a9842791f440e285d89e9d80b898e996411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395685
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-11-18 18:27:11 +00:00
Sam Rawlins 922847af5f DAS plugins: Only analyze (and hence visit) .dart files
In it's current form, the lint rules are given _every_ file in the
context root, including things like CHANGELOG.md, YAML files, etc, and
it tries to parse them as Dart source.

Change-Id: I0bd5a682fa4f22b857520bb99e7a3d8990c93e37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-18 17:53:10 +00:00
Konstantin Shcheglov 17a2f16926 Elements. Add PropertyAccessorElement2 and PropertyAccessorFragment.
I found a number of places where we need to access `variable3`, so
it might be convenient to have a common interface that provides it.

Still, there are many places where we want to know that this is
specifically `GetterElement`, to separate interfaces for them are
also useful.

Change-Id: Ib671dc3bdb9a04a022fd74921f8ccedcdba79643
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395701
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-18 17:36:50 +00:00
Konstantin Shcheglov 1293500b0c Elements. Migrate AssignmentVerifier.
Change-Id: I45a3c4df63250c611f011d61023ed74485145b78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395780
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-18 16:57:21 +00:00
Konstantin Shcheglov b80fdcb683 Elements. Migrate ErrorDetectionHelpers.
Change-Id: I50b08924a4be96210378a9ad56a9d671a030d5f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-18 16:56:39 +00:00
Paul Berry 58f9beb6d4 [mini_types] Add a Type.substitute method.
This method will be used by a follow-up CL that adds support for
generic functions, since the implementation of `==` and `hashCode` for
generic functions needs to perform substitutions in order to recognize
that alpha-equivalent types (such as `T Function<T>()` and `U
Function<U>`) are equal.

Change-Id: If641c4d0ae48708abf3701853014dc52dfc559c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395684
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-11-18 15:46:17 +00:00
Parker Lougheed e1c76b2805 [linter] Mark latest diagnostic docs as published
Closes https://github.com/dart-lang/sdk/issues/56882

Change-Id: Id41adea71251731b638aa21e23a452a1dc19ed51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-11-18 15:29:08 +00:00
Paul Berry bb8db16297 [mini_types] Implement and test hashCode and equality logic.
Previously, the `hashCode` and `==` logic for the `Type` hierarchy
used a short-cut: convert the type to a string and then hash or
equality-check the result.

However, that trick won't work for generic function types (which I
intend to implement in a follow-up CL), because generic function types
that are alpha-equivalent (i.e. equivalent except for the names of
type formals) need to be considered equal. So, as preparation for
supporting generic function types, this change adds full
implementations of `hashCode` and `==` for all the classes in the
`Type` hierarchy.

Change-Id: I8312d22cabaeb8c38cd58da80acdb3f068ee5c2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395620
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-11-18 14:21:08 +00:00
Ömer Sinan Ağacan 47681c79c8 [dart2wasm] Simplify UTF-8 decoder flag scanning
Simplify the VM-specific `scan` function that assumes an instruction
called `Utf8ScanInstr` and scans the input in chunks to be able to use
the instruction. Instead scan the whole input in one loop.

Change-Id: I9c796e0728e46687653b623effb214ebc93cc01c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395960
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-11-18 13:30:17 +00:00
Jens Johansen 3b707d5e72 [CFE] Fix more crashes on invalid reference to this
Change-Id: I989688c815347f316da1fcea851cd6fbd207b47c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395522
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-11-18 11:38:16 +00:00
Jens Johansen 8e89041e9e [CFE] Fix crash in AmbiguousBuilder in ForIn
Change-Id: I944b6dfc26fb294f7fbf9b2df12df7eac378ae45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-11-18 11:35:40 +00:00