Commit Graph

54490 Commits

Author SHA1 Message Date
Paul Berry ecc83311e1 [messages] Convert expected type arguments errors to literate diagnostic API.
Converts the analyzer's logic for reporting the following errors to
use the new literate diagnostic reporting API:

- expectedOneListTypeArguments
- expectedOneSetTypeArguments
- expectedTwoMapTypeArguments

Change-Id: I6a6a6964a1a020eee27d0636ddb39c7f71619fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471302
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-07 11:44:10 -08:00
Konstantin Shcheglov ef20543995 Prepare to publish analyzer 10.0.0, _fe_analyzer_shared 93.0.0, analysis_server_plugin 0.3.5, analyzer_plugin 0.14.0, analyzer_testing 0.1.8
Change-Id: I22aaf17a81027ac44d5f23b114ece789d66eed93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-01-07 11:25:23 -08:00
Paul Berry 9d5618a26b [messages] Rework invalid override diagnostic reporting.
Changes the diagnostic reporting logic for the following diagnostic
codes to use the analyzer's literate diagnostic reporting API:

- invalidImplementationOverride
- invalidImplementationOverrideSetter
- invalidOverride
- invalidOverrideSetter

Change-Id: I6a6a696433e729c1122995d9ac2a183c7cdbfa04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-07 10:49:59 -08:00
Daco Harkes 6efd914b36 [dartdev] Delete and create dylibs instead of truncate - test
Roll in regression test https://github.com/dart-lang/native/pull/2933
to test https://dart-review.googlesource.com/c/sdk/+/471240.

Closes: https://github.com/dart-lang/native/issues/2921

Change-Id: Id3aab286f2aeb4654c69cbc34ee0d15f29013565
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471262
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
2026-01-07 10:29:56 -08:00
FMorschel ac0be94edd [analyzer] Adds lineNumberDifference and onSameLine methods to LineInfo
Bug: https://github.com/dart-lang/sdk/issues/61186
Change-Id: Ib0584203b000103f8137901c258a86ec571ff74c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471061
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-01-07 10:15:29 -08:00
Brian Wilkerson c4ed22e204 Update the member sorter to handle primary constructor bodies
With these changes, primary constructor bodies will sort with
constructors (based on whether `sort_members_first` is enabled), but
will always be before other constructors.

Change-Id: If6719dedd5178c384712a5d08b4e74a38aaf54a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471280
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-01-07 09:29:04 -08:00
Konstantin Shcheglov 3c219ecc8b PrNP. Fixes for UnusedLocalElementsVerifier.
Report only declaring formal parameters.

Fix for the target length.

Change-Id: I858ee9e409a7312401a36e306ce89181c93e876f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471029
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-01-07 09:22:40 -08:00
Alexander Markov d95e527aab [dyn_modules] Improve support for extendable mixins with private members
When mixin is applied, its instance members are cloned and copies
of the members would override original members.

This change fixes bugs and improved usability of extendable mixins with
private members:

- All instance members of extendable mixins and mixin classes are
  marked as can-be-overridden to allow overriding by cloned members
  when mixin is applied.

- TFA no longer takes privacy into account, as private members of
  mixins can be overridden by their clones in other libraries.

- Dynamic module validator always unwraps cloned members to originals
  before verifying if overriding is allowed. This eliminates overriding
  errors between clone(s) and original members of mixins.

TEST=pkg/dynamic_modules/test/data/mixin_private_member1,
     pkg/dynamic_modules/test/data/mixin_private_member2

Fixes b/470461203
Fixes b/469094721

Change-Id: If369c42c58e5ea4d707be83b1e7078ee9a8cc3ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470803
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2026-01-07 08:26:38 -08:00
Sam Rawlins c193f19b69 analyze: Simplify ContextBuilderImpl
* `_getAnalysisOptions` did not use it's first parameter, so remove it.
* `_getAnalysisOptions` is only ever passed a non-nullable
  `optionsFile`, so make it non-nullable.
* `DriverBasedAnalysisContext.allAnalysisOptions` are
  AnalysisOptionsImpl objects, so leave them alone and prevent later
  casting.

Change-Id: Ida490f6a9eeba16c14727e48a306ea336a7ce8a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470500
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-07 08:21:43 -08:00
Daco Harkes 3e020921c6 [dartdev] Delete and create dylibs instead of truncate
TEST=Tested locally. Will add a test case upstream in dart-lang/native
     and roll that in.

Bug: https://github.com/dart-lang/native/issues/2921
Change-Id: I8010131cc70afe5bcee30edf076f18efe0c9a8c4
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471240
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2026-01-07 03:52:21 -08:00
Ömer Ağacan c552af0a9e [dart2wasm] Minor refactoring and comments in variable declaration compiler
Refactoring:

- Update the checks when updating a local for a captured variable to
  check whether `local` is null, instead of whether it's not updated.

  If the `local` is available then we know that it's not updated. It's
  more direct to check whether we've created a local for the variable or
  not.

- Add an assertion checking the the capture field and local for a
  variable can only differ in nullability.

Documentation:

- Document that context field for a captured local will always be
  nullable, to be able to allocate the context without dummy values.

- Document in a few places that `!capture.written` means the variable is
  captured but not updated, so they can be held in a local (instead of
  getting them from the context on every read).

Change-Id: I66048cb36f75e35ee3c479c41f2bbfca247a990f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470981
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2026-01-07 03:38:06 -08:00
Ömer Ağacan 4b2f4cc809 [dart2wasm] Minor refactoring in dummy value code
- Remove redundant `prepareDummyValue` call in
  `getGlobalForStaticField`.

- With the previous change, `prepareDummyValue` can be made private.
  Make it private and rename it to `parepareDummyValueGlobal` to make it
  clear that it creates a global.

- Make `prepareDummyValueGlobal` return early when the type doesn't need
  a dummy value global. With the early return the function body is
  de-indented one level.

- Document `DummyValueCollector.dummyStructGlobal`.

Change-Id: I6dd93ca5fb25898c1b05dda03573905e76450923
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471220
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-01-07 03:23:38 -08:00
Jens Johansen 7be40e97f9 [CFE] Fix leak introduced with "Add support for allowing imports of unsupported libraries"
https://dart-review.googlesource.com/c/sdk/+/469240 (originally landed
as https://dart-review.googlesource.com/c/sdk/+/465760) introduced a
leak by saving assessors on dill libraries. Note that we _do_ save
assessors on source libraries, but as these are converted to dill
libraries (via the incremental compiler, i.e. in the setting where the
leak happens) this is fine, but saving them on dill libraries means that
these will retain access to old/invalidated/recompiled libraries and
thus leak. The weekly bot has been red since the run on 2025-12-21.

This CL fixes the issue by reporting the wanted errors when processing
the import instead of later and can thus stop saving the data that
causes the leak. It also moves when it's done so the error is issued for
outline compiles too.

Change-Id: I88385ef193edfe45cd56b5e42a442c0e2bda7608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471200
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2026-01-07 02:45:15 -08:00
Daco Harkes 42249a3713 [dartdev] dart compile report which packages have hooks
Closes: https://github.com/dart-lang/sdk/issues/62320

Change-Id: I45d51abf0d50725f57cabe7e0b662ceaad88edc0
Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471180
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Commit-Queue: Michael Goderbauer <goderbauer@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2026-01-07 01:23:35 -08:00
Johnni Winther 80e58d2d75 [cfe][PrimaryConstructors] Refactor building of initializers
This refactors building of initializers to be fully contained within the [_InitializerBuilder].

This prepares for handling primary constructor body declarations which require a change to how building of constructor initializers are triggered. Currently it is assumed the initializers can be processed with the constructor declaration has been parsed, but with primary constructor body declarations, such processing needs to be postponed. Streamlining the logic for processing the initializers makes it easier to accommodate this.

Change-Id: Ic12e208bce5d1ed9b3800335466afcaf391c1b9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-01-07 00:50:33 -08:00
Ivan Inozemtsev 5536cac9c4 [release] Increase version on main to 3.12
Change-Id: I278eb371cd7e8d776a71c1c6f6920b9d0f5598bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/460043
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-01-07 00:02:21 -08:00
Nate Biggs 600f8a9601 [dart2wasm] Use default value sentinel when member body unreachable
This issue was partially fixed by:
https://dart-review.googlesource.com/c/sdk/+/428541

However, this only looked at the case of a member in an abstract class
that itself was made abstract if it was unused. TFA does not make the
member abstract if the enclosing class is not abstract:
pkg/vm/lib/transformations/type_flow/transformer.dart#L2289

Instead we can use the unreachable metadata to identify these
unreachable body members (that have default values cleared):
pkg/vm/lib/transformations/type_flow/transformer.dart#L736

Attached test fails prior to this fix.

Bug: https://github.com/dart-lang/sdk/issues/62273
Change-Id: I1ccb818ec41bbe805ee828be0b96ba23e73beae4
Tested: Introduced unit test.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469280
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2026-01-06 21:24:51 -08:00
Konstantin Shcheglov 8be9f9fa3b PrNP. Use element model to report diag.privateNamedNonFieldParameter
Change-Id: If7790d834ad1d6ae15f03112bab516bff249e79c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470943
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-01-06 14:55:55 -08:00
Paul Berry 76e703c68d [messages] Convert URI related messages to use literate API.
Converts the analyzer logic that reports the following messages to use
the literate diagnostic reporting API:
- duplicatePart
- invalidUri
- partOfDifferentLibrary
- partOfNonPart
- partOfUnnamedLibrary
- uriDoesNotExist
- uriHasNotBeenGenerated
- uriDoesNotExistInDocImport

Change-Id: I6a6a6964a121855a4a0407b829195f6c60d049fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471024
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-06 14:48:15 -08:00
Paul Berry eff289f424 [messages] Convert duplicate definition messages to use literate API.
Changes the analyzer logic that reports the following messages to use
the literate diagnostic reporting API:
- duplicateDefinition
- duplicateFieldFormalParameter
- duplicateFieldName
- duplicateVariablePattern
- prefixCollidesWithTopLevelMember
- privateNamedParameterDuplicatePublicName

Also, makes the parameter lists for all these messages uniform: every
one of these messages now accepts a single String parameter named
`name`.

Change-Id: I6a6a696426d6176eb3ff2401e3b4d68bed823323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471023
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-06 14:47:51 -08:00
Jake Macdonald 1a0371034b Additional fixes for scenario replays
- Skip notifications from analyzer
- Hard code responses to certain startup logs if they are unexpected
- Use cli_util to show loading spinner and get sdk location
- Update normalize to substitute the sdk location
- Make id field optional on message (notifications don't have ids)

Change-Id: Ia5276eef554a3afefeae227fa7351f902d21131e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471060
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-06 13:34:56 -08:00
Kevin Moore ad6fb28849 pkg:perf_witness update SDK constraint so it works with Flutter @ master
Change-Id: I91793402bdd4114822c5eff1d251bb2744721f05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468982
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2026-01-06 13:10:38 -08:00
Paul Berry e24ab2a67d [messages] Convert creation_with_non_type messages to use literate diagnostic API.
Adds type parameter names to the diagnostic messages
`constWithNonType` and `newWithNonType` (both of which are reported to
the user as `creation_with_non_type`), and adjusts the code that
reports these diagnostic messages to use the new literate diagnostic
reporting API.

Change-Id: I6a6a696470bbc684950e65ccb0e5a780e79ea463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471021
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-06 11:52:04 -08:00
Konstantin Shcheglov 60f870baae PrNP. Move reporting errors to analyzer/ and front_end/.
This simplifies reporting logic by avoiding "already reported by the
parser" case. Also, in a follow up CL I plan to support declaring formal
parameters, which do not look as `this._foo` syntax. Supporting this in
the parser would require duplicating more complex logic of building
elements in the analyzer.

Another way to think about it, is that from parser point of view the
code is fine - we did not skip or add any tokens. We can parse and
format this code. But the semantics is not quite right, so it makes
sense to put it in a different place.

Change-Id: I783ed6780e6d66e276c5ed44f08e6ac04145cd1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470920
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-01-06 11:30:01 -08:00
Paul Berry 658b656941 [messages] Clean up constWithUndefinedConstructor diagnostic.
This diagnostic is reported in two circumstances:

- During resolution of a dot shorthand like `const .foo()`, when the
  implicitly-referred to class doesn't have a constructor with the
  given name.

- During resolution of a const constructor invocation like `const
  int.foo()`, when the explicitly-referred to class (`int` in this
  example) doesn't have a constructor with the given name.

In both cases, the diagnostic message includes the names of both the
class and the constructor that was sought. But in the first case, the
class name was accidentally derived from the type inference context
rather than the dot shorthand context; these are different in the case
where the dot shorthand appears on the RHS of `==`. Fixed by supplying
the correct context type.

This bug was discovered in the process of converting the analyzer to
use the new literate error reporting mechanism: I needed to assign a
type to the diagnostic message parameter that was to contain the class
name and discovered that I couldn't give a consistent type, because it
was sometimes being filled in with a class name string, and it was
sometimes being filled in with a type. With the fix, it is always
filled in with a class name string.

I also included tests of the other dot shorthand related diagnostics
that mention the class name (they don't exhibit the same bug), as well
as a typo fix for `wrongNumberOfTypeArgumentsDotShorthandConstructor`
(which had mismatched quote symbols).

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

Change-Id: I6a6a696421b68397b86aac9b1a6e91cce08250ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470942
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-06 11:14:50 -08:00
Paul Berry f4dfbbe4a4 [messages] Convert more diagnostics to literate diagnostic reporting API.
The only changes in this CL that were manually written are those in
`messages.yaml`. The others were produced by running the standard
diagnostic message code generator and then running the script
`use_literate_api_in_analyzer.dart`.

Change-Id: I6a6a69645bab7cf8f26ec9524a7bc2294e4a3b3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471020
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-01-06 10:16:24 -08:00
Konstantin Shcheglov a8f85d3d86 DeCo. Support for private named declaring formal parameters.
Bug: https://github.com/dart-lang/sdk/issues/61701
Change-Id: I5e1c142fe70bd7a17c9a87f5636e638209ce36e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470841
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-01-06 09:15:41 -08:00
Alexander Markov a242cf768a Arm64 assembler
Issue: https://github.com/dart-lang/sdk/issues/61635
Change-Id: I3ce3c19e60b72ce879103936e0e33abe8729d9cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468440
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-01-06 06:39:17 -08:00
Alexander Markov c985ba8e14 [vm,dyn_modules] Mark classes mentioned in supertypes as implicitly callable
When creating an instance of a class or calling a factory constructor,
dynamic module may pass a vector of instantator type arguments which
includes types mentioned in supertypes along with types specified
at the call site.

So, for every exposed generative constructor and factory all the types
mentioned in the supertypes of their declaring classes should be
annotated as implicitly callable in order to prevent their tree-shaking.

TEST=pkg/dynamic_modules/test/data/super_type_param
Fixes b/470446652

Change-Id: I6abe570261a8f23f8022cb77110c3a5ec40ccbe8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2026-01-06 06:16:41 -08:00
Paul Berry 33d7b34d6e [messages] Convert uses of atElement2 in error_verifier.dart.
Changes the uses of `DiagnosticReporter.atElement2` in
`inheritance_override.dart` to use the new literate diagnostic
reporting mechanism.

Change-Id: I6a6a6964b4585d173bbdf2918b3ec1c9e27503fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470804
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-01-06 05:54:31 -08:00
Paul Berry 8f3a678dce [messages] Convert more uses of atElement2.
Changes the uses of `DiagnosticReporter.atElement2` in
`evaluation.dart`, `base_or_final_type_verifier.dart`, and
`getter_setter_types_verifier.dart` to use the new literate diagnostic
reporting mechanism.

Change-Id: I6a6a6964cff8afd9867c2606f3aea334f135cf03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470820
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-06 05:54:20 -08:00
Johnni Winther 77073f7992 [cfe][InternalNodes] Add Argument nodes
This adds the sealed class Argument with subclasses PositionalArgument and NamedArgument to the internal AST and uses these through out compilation. This cleans up a lot of the handling of arguments during inference.

Change-Id: If604895ee578d45874d4760e5ead2426b19b96ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469621
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2026-01-06 02:30:12 -08:00
Johnni Winther 0a154753c6 [parser][InternalNodes] Add handlePositionalArgument and handlePositionalRecordField
This [handlePositionalArgument] and [handlePositionalRecordField] methods to the parser listener, allowing listeners to normals arguments and record fields

Change-Id: I3947e196dafffea2ab383f797904c857db8327ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469620
Reviewed-by: Jens Johansen <jensj@google.com>
2026-01-06 02:30:12 -08:00
Ömer Ağacan 9da59f310a [dart2wasm] Minor refactoring in ClassInfo
- Remove unused `masquerade` member.
- Make `upperBound` private.
- Fix spelling of `Dart` and `Wasm` in comments.

Also use `ClassInfo.typeWithNullability` in one more place in
`translator.dart`.

Change-Id: I08ef9a0599c9c3ecbe2b8d9e4a1d63124695813b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470662
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2026-01-06 01:41:47 -08:00
Sam Rawlins 92bebe661b DAS plugins: Begin storing analytics data
This data is collected on shutdown, the same as the legacy analytics data.

This is implementation for some of the analytics we want to collect,
specified at go/dart-analyzer-plugin-analytics.

* How many plugins are enabled for each context?
* How many lint rules are registered for each plugin?
* How many warning rules are registered for each plugin?
* How many fixes are registered for each plugin?
* How many assists are registered for each plugin?

Change-Id: I36c176737c194550e1947985576ed461fd8a1bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-05 21:28:18 -08:00
Paul Berry e2018b8f51 [messages] Clean up diagnosticRange using firstFragmentLocation.
The advantage of using `firstFragmentLocation` rather than
`firstFragment` is that `firstFragmentLocation` doesn't disable
fine-grained dependencies.

Change-Id: I6a6a696482ffef9fabc2688a14ea417b592c65fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-05 14:12:42 -08:00
Paul Berry 04392c907a [messages] Convert uses of atElement2 in inheritance_override.dart.
Changes the uses of `DiagnosticReporter.atElement2` in
`inheritance_override.dart` to use the new literate diagnostic
reporting mechanism.

Change-Id: I6a6a6964bb0ba2b90b1340730730d8579f7f6309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470800
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-05 14:11:26 -08:00
Ben Konyi cd043efb84 [ Kernel Worker ] Expose --include-unsupported-platform-library-stubs
Exposes the `--include-unsupported-platform-library-stubs` flag to
`kernel_worker` for use when generating SDK summaries. Required to
support imports of unsupported libraries (e.g., `dart:ffi`) in Flutter
widget previews using DDC.

Change-Id: I15cc568ce12fb3d18cdd345e667dcff2ad83d4fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470860
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2026-01-05 13:46:45 -08:00
Paul Berry a1cf5d8d0d [messages] Convert some more analyzer diagnostic reporting logic.
These changes were produced automatically by the script
`use_literate_api_in_analyzer.dart`.

Change-Id: I6a6a696455cd0a49533eb5e69cc99773c602bea4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470780
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-05 13:38:42 -08:00
Paul Berry 8fff524639 [messages] Convert uses of atElement2 in member_duplicate_definition_verifier.dart.
Changes the uses of `DiagnosticReporter.atElement2` in
`member_duplicate_definition_verifier.dart` to use the new literate
diagnostic reporting mechanism.

Note that the literate diagnostic reporting mechanism doesn't directly
support an `atElement` method. This is on purpose, because reporting a
diagnostic at an element is risky: if the caller isn't careful to make
sure the element's declaration site is in the file for which errors
are being reported, the offset and length will be meaningless. To help
manage that risk, I've added an extension `diagnosticRange` on
`Element`, which checks that the element is declared in the expected
source file before returning the diagnostic range.

Change-Id: I6a6a6964a4a3cbcc5a6b58e5a86def8b6d208f0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470740
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-01-05 11:39:19 -08:00
Konstantin Shcheglov 52b5af6ae7 DeCo. More tests for conflictingConstructorAndStaticField and conflictingConstructorAndStaticMethod.
Bug: https://github.com/dart-lang/sdk/issues/61701
Change-Id: Ic5fa7b15f83c98b6963a0de1eedc91c9d91b2c15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470520
Reviewed-by: Paul Berry <paulberry@google.com>
2026-01-05 11:28:41 -08:00
Konstantin Shcheglov e71515e493 DeCo. Print more flags in manifest items.
Change-Id: I8f3608c85c876c115c0ca3fa79bb35031d8bac74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470560
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-01-05 11:17:59 -08:00
Konstantin Shcheglov d0a023088e DeCo. Infer extension type representation types
Fixes cases where extension type primary constructor parameters with
implicit types were left as InvalidType, producing incorrect
representation signatures and type erasure results.

- Default an implicit representation type to Object? when no better type can be inferred.
- Infer the representation type from an implemented `it` member when available.
- Run extension type evaluation after top-level inference and refactor
  buildExtensionTypes to operate over linking elements rather than AST nodes.
- Compute extension type dependency edges via representation type traversal and preserve existing cycle detection behavior.
- Update overridden-member lookup for extension types to consult `redeclared`.

Change-Id: I3cc7edd7d065060b8c736b745c619f98a2e93a6f
Bug: https://github.com/dart-lang/sdk/issues/61701
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469780
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-01-05 11:08:07 -08:00
Fedor Shcheglov 09dcc24207 Test that primary constructors can initilaize fields
Change-Id: Ia43d8c44c9b695f823fd80087dfd08efd47367e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-01-05 10:46:02 -08:00
Jake Macdonald c2dc8f62a3 Add current directory project generator
This makes iterating on things faster, with the downside of requiring a clean git tree
to avoid bashing over pending changes.

Change-Id: I5725c288f6f4f4665e9cd8cc8d91cb77d214df2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2026-01-05 09:08:53 -08:00
Jake Macdonald fb40ed857a fix the normalize tool to only replace the path of the workspace uri with the placeholder (the path appears as a bare path in many parts of the file also).
Change-Id: Idccdd218b2c25db444c01efb3ce077117eb354f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470320
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-05 09:03:59 -08:00
Aman Gupta ebc9f84f50 chore: Fix typos in analysis_server error messages
Closes https://github.com/dart-lang/sdk/pull/62336

GitOrigin-RevId: 9871d040bbf7c85208e61962583b209a8418ffa5
Change-Id: I7b934e1df6a667c2f43ac4ff10552a3d5fae292b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-01-05 09:00:50 -08:00
Jake Macdonald e88d67e34a add a way to manually replay server logs one at a time or send custom messages (without requiring LSP headers)
Change-Id: Id662f52df392aab65228a2b69a830ad6058ebd55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
2026-01-05 08:42:00 -08:00
Daco Harkes b277407152 [ffi][cfe] Support @Native() external Array<Struct> fields
For structs, we were already loading the size of the struct at
runtime for the size of the memcopy. This CL makes that work for
the `Array`s as well.

TEST=pkg/vm/testcases/transformations/ffi/regress_62087.dart
TEST=tests/ffi/native_assets/asset_absolute_test.dart

Closes: https://github.com/dart-lang/sdk/issues/62087
Change-Id: I15a5796d713879a613971e080d18101111704b9b
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-arm64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-debug-arm64-try,vm-aot-mac-debug-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-asan-mac-release-arm64-try,vm-asan-win-release-x64-try,vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try,vm-ffi-dyn-mac-debug-simarm64_arm64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-tsan-mac-release-arm64-try,vm-ubsan-linux-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-ubsan-mac-release-arm64-try,vm-ubsan-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464706
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
2026-01-05 08:01:26 -08:00
Simon Binder d2ee7a3207 [dartdev] Use dart build cli in Dockerfile template
This updates the `Dockerfile` generated by `dart create` with the
`server-shelf` template to use `dart build cli` instead of `dart
compile exe`. The benefit of using the `build` command is that it runs
hooks and bundles code assets. These assets should also be present in
the container image.

TEST=Tested manually (create template, build image, run)

Change-Id: Ia8ccbba4ea6631ec6d5bb8866fd59ae4821375ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/470661
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2026-01-05 03:29:09 -08:00