Commit Graph

125 Commits

Author SHA1 Message Date
Sam Rawlins 5a94256582 meta: Introduce TargetKind.importDirective
Fixes https://github.com/dart-lang/sdk/issues/63467

Change-Id: I02f048405878d9ca578f8cbea318c59697f2811b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509021
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-06-03 13:34:57 -07:00
Konstantin Shcheglov 26fc53e109 Add test for unusedResult when used for a named field value in a record literal.
Also small tweaks for the documentation and test names.

Found a hole while running in google3.
https://dart-review.googlesource.com/c/sdk/+/488624

Change-Id: I80f1bd38da028203fd9ffc281ac5f2a111b2becd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-07 10:13:51 -07:00
Daco Harkes aa08628c36 [record_use][tfa] Moving isBeingUsed to NativeCodeOracle
TEST=pkg/compiler/test/record_use/record_use_test.dart
TEST=pkg/dart2wasm/test/record_use_test.dart
TEST=pkg/vm/test/transformations/record_use_test.dart

Change-Id: Ia277d274046ac3b587732bc9cf853dce12427db9
Cq-Include-Trybots: luci.dart.try:dart2wasm-asserts-linux-chrome-try,dart2wasm-asserts-minified-linux-d8-try,dart2wasm-linux-chrome-try,dart2wasm-linux-d8-try,dart2wasm-linux-firefox-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-canary-linux-try,dart2js-hostasserts-linux-d8-try,dart2js-linux-chrome-try,dart2js-linux-firefox-try,dart2js-mac-chrome-try,dart2js-mac-safari-try,dart2js-minified-csp-linux-chrome-try,dart2js-minified-linux-d8-try,dart2js-unit-linux-x64-release-try,dart2js-win-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487360
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-03-17 01:46:44 -07:00
Lasse R.H. Nielsen a17099d161 Update package:meta API and docs.
Changes private types in public signatures to `Object`.
Should not change anything for code that accesses the members
directly, an unspeakable type is no different from `Object`,
unless you try to access members on it, and none of the types
have useful members, they're all of the form
`class _C {const _C();}`.

If any code tries to recognize annotation values from
the expression's *static* type, not the runtime type
of the constant value itself, such code would be affected
by this change. It's not expected that such code exists.

Updates documentation to have a single-line first paragraph
with a noun phrase describing the value ("Annotation for ...").

Updates the documentation for `visibleForTesting` to say that
you can use the annotated declaration from a `test/` file in
a different package. (You can, and it's even potentially useful.)

Some spot-wise wording changes in documentation.

Change-Id: I4e8cda477ea1c302bed7dd52bdff967e6719209b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481121
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2026-02-18 08:06:25 -08:00
Daco Harkes 61babf9699 [record_use] Stop recording annotations
Stop recording annotations (in the VM and dart2wasm).

The visitor will stop visiting as soon as it is in an expression that
is in the annotations list.

The tests have been migrated so that their constants occur in the executable code instead of annotations.

One test has been kept to see that the annotations no longer are
recorded:
TEST=pkg/vm/testcases/transformations/record_use/instance_method.dart

A new test has been added to ensure we're also recording constants
nested inside other constants.
TEST=pkg/vm/testcases/transformations/record_use/nested_instance_constant.dart

Closes: https://github.com/dart-lang/native/issues/2977
Change-Id: I5d814c8500b510628025ab2daeb115e782dd423a
Cq-Include-Trybots: luci.dart.try:dart2wasm-asserts-linux-chrome-try,dart2wasm-asserts-minified-linux-d8-try,dart2wasm-linux-chrome-try,dart2wasm-linux-d8-try,dart2wasm-linux-firefox-try,dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-optimized-jsc-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try,dart2js-canary-linux-try,dart2js-hostasserts-linux-d8-try,dart2js-linux-chrome-try,dart2js-linux-firefox-try,dart2js-mac-chrome-try,dart2js-mac-safari-try,dart2js-minified-csp-linux-chrome-try,dart2js-minified-linux-d8-try,dart2js-unit-linux-x64-release-try,dart2js-win-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/478440
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-02-05 01:13:52 -08:00
Sam Rawlins 7e5885e78a analyzer: Allow awaitNotRequired on a Future-returning typedef
This includes bumping meta to 1.18.1.

To support https://github.com/flutter/flutter/issues/168555

Change-Id: I6830a413efcf9939467e97faf58b1255d2d3d8eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-26 18:14:50 -08:00
Sam Rawlins da68d458e1 meta: Introduce TargetKind.exportDirective, .partOfDirective, and deprecate .directive
Work towards https://github.com/dart-lang/sdk/issues/62366

Change-Id: I05ff73fcb5c7fdef88412213d68eb814c2ef2492
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-14 13:33:59 -08:00
Sam Rawlins ed640293af meta: Annotate _Literal with TargetKind.constructor
Work towards https://github.com/dart-lang/sdk/issues/62253

The removed tests are for code which is no longer related to this
warning. Reporting on an extension type or a method is the purview of
the `invalid_annotation_target` warning. I'll note this in the summary.

Change-Id: Ide349bc1e414da339b9e89da25e383859a8144a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469761
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-12-30 09:29:37 -08:00
Sam Rawlins 89250d64b9 meta: Annotate nonVirtual with TargetKind.overridableMember
In the analyzer, reduce our custom warning for `nonVirtual`, (largely
replaced by the existing `invalid_annotation_target` warning). The
tests for that warning are mostly covered by the existing
`invalid_annotation_target` tests, but I added a few to fill some gaps.

Otherwise, we still report a specific warning for this annotation being
placed on an abstract member, or an instance member of an extension
type.

Work towards https://github.com/dart-lang/sdk/issues/62253

Change-Id: Ibcde2f99cf53460bff636bfc8bbf07e80779a942
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469104
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-23 09:47:27 -08:00
Sam Rawlins 971aa0b12a meta: Annotate visibleForOverriding and visibleForTesting with TargetKinds
In the analyzer, remove our custom warning for `visibleForOverriding`,
`invalid_visible_for_overriding_annotation` (replaced by the existing
`invalid_annotation_target` warning). The tests for that warning are
mostly covered by the existing `invalid_annotation_target` tests, but
I added a few to fill some gaps.

Work towards https://github.com/dart-lang/sdk/issues/62253

Change-Id: Ie960db6ebe007afde787f68e4b6b9f20a1835639
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468702
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-12-18 12:05:43 -08:00
Sam Rawlins 340ede4caf analyzer: Allow TargetKind.constructor annotations on classes with primary constructors
Work towards https://github.com/dart-lang/sdk/issues/62253

Change-Id: I7a80c4d7d7ee777d1e8dbd1166bc0df35c0e1825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468562
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-17 17:39:16 -08:00
Paul Berry bdff48309f [meta] Remove @experimental annotation from @redeclare.
This annotation has been supported for some time, and is a valuable
piece of the "extension types" feature.

Change-Id: I6a6a6964f02564ff673cbdd6fca6b8bc69e5a06a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-09-23 16:38:03 -07:00
Sam Rawlins b7cb6c3ed0 meta: Add an @awaitNotRequired annotation.
Fixes https://github.com/dart-lang/sdk/issues/46218

Change-Id: Ic7cbfaf2512fbed3a7e0117a26856591e658c725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424685
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-04-25 12:41:14 -07:00
Kevin Moore 490708384e [pkg:meta] fix doc comments for doNotStore
Change-Id: I8ce8613b03453be218159572373af31e1233965b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424706
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-04-25 11:24:23 -07:00
Kevin Moore e81bc24cfb [pkg:meta] deprecate Required
And a bit of other lint-ish cleanup

Change-Id: I515d37706c48acff69151e075667c7e4426a742d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-04-24 08:24:51 -07:00
Sigurd Meldgaard 3767d20e56 Bump language version for pkg/meta
Extracted from https://dart-review.googlesource.com/c/sdk/+/397164
Which migrates the sdk to resolve as a pub workspace

Pub workspaces requires a language version of 3.5.

Change-Id: If8e4f61fbf28c3fa9f22d2f2ed116fa179e30a22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412660
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2025-03-06 07:43:45 -08:00
Moritz 81daf8e563 Use package:record_use
- Rename resource identifiers in the VM to usage recordings.
- Use package:record_use for serialization.
- Rename and use the experimental flag for this feature.
- Recognize tear-offs and top-level methods as well.

Next steps:

- Add constant instance recording.
- Expose API in package:native_assets_cli's link callback.

TEST=pkg/vm/test/transformations/record_use_test.dart

Change-Id: I8af3625165f78925ae943711245af93a239d1012
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383040
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-09-12 08:47:53 +00:00
Matan Lurey 15f666c3eb Fixed @doNotSubmit to prohibit same-library, allow nested functions.
Bug: https://github.com/dart-lang/sdk/issues/55558
Change-Id: Ib0aa786e81e6fc9fecc8af7a3edbbd541cabcaad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364382
Commit-Queue: Matan Lurey <matanl@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
2024-07-02 00:10:23 +00:00
Sam Rawlins e04c53d5ac meta: add TargetKind to @factory
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I5c0608637f2feb9986e890f3c83cf02884bef7f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369789
Commit-Queue: Sam Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-06 15:39:56 +00:00
Sam Rawlins 8029fdf79a meta: Add a TargetKind for _Sealed
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ibac1f71f6cbb9432150b49b8565bf740efa1be32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369765
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-05 20:28:57 +00:00
Sam Rawlins a451edf978 meta: Use TargetKind.overridableMember on MustBeOverridden
Change-Id: I6f19eeac5efac2c56eabecd32bc6e2032d1ba764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369526
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-06-04 17:29:09 +00:00
Sam Rawlins 28be4efd8f meta: require that @mustCallSuper only annotates overridable members.
Previously, this behavior was custom-wired into the Dart analyzer, but
now it is specified with TargetKinds.

In the analyzer we remove special annotation-target-verification for
`mustCallSuper`.

Change-Id: Ibd3ada0a612069c5286facffaad557671c7a85b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-31 21:41:43 +00:00
Sam Rawlins 97d4d12dc0 meta: Add TargetKinds for @immutable; narrow error range for "invalid annotation" warnings.
This change looks big, and this is because we change the range of all
of the "INVALID_x_ANNOTATION" from the whole annotation (like
`@Immutable("...")`) to just the annotation identifier (like
`Immutable`). This affects many tests.

The error range is changed so that we can consistently use the
`RemoveAnnotation` fix to fix these warnings; it just needs a
consistent error node, so that it can find the Annotation node above.

All this to support `TargetKind`s for `@immutable`, so that we can
remove the custom "INVALID_IMMUTABLE_ANNOTATION" message.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ifd64e154986b6cbcbafeb9420ca8d0949653e618
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367881
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-28 18:28:49 +00:00
Sam Rawlins 0d5830e541 meta: Support @doNotStore on constructors and mixins
There were no tests of this component of the annotation's description:

> The annotation can also be applied to a class to implicitly
> annotate all of the valid members of the class

So I add those as well.

Bug: https://github.com/dart-lang/sdk/issues/48476
Change-Id: If5f0f4c6057f57b4dfd01d8f648110d69fbc5eb4
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/367880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-23 16:26:39 +00:00
Sam Rawlins 1bfae529f7 meta: Sort TargetKinds
Change-Id: I9ecc0ac8050bdac6dd61b8e67e889a57cb0a0fec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365622
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-05-08 18:30:19 +00:00
Sam Rawlins 73f5417b23 meta: introduce TargetKind.overridableMember
Fixes https://github.com/dart-lang/sdk/issues/55387

Change-Id: I379035f89ca3df7f6062a2f45da7b9a230f9c750
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-05-02 14:43:58 +00:00
Sam Rawlins f759281cd8 meta: introduce TargetKind.optionalParameter
Fixes https://github.com/dart-lang/sdk/issues/55567

Change-Id: I45a1b6af9d9522b2f374ee627cc07f1d3fb47817
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-25 18:55:59 +00:00
Matan Lurey dbd8e3fe32 Ignore abstract classes, mixins, sealed classes.
Bug: https://github.com/dart-lang/sdk/issues/52965, https://github.com/dart-lang/sdk/issues/55550
Change-Id: I8ec70f909f55663eb299764f0402c5a992729846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364206
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Matan Lurey <matanl@google.com>
2024-04-24 18:37:15 +00:00
Sam Rawlins eb7ba49329 analyzer: Allow @useResult on constructors
I also want to allow `@doNotStore` on constructors (kind of weird, but
sound, and just to be consistent). But that annotation currently has
no functional tests.

Change-Id: I66d276008294c03d9720809c4418294bd0c416ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361284
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-04-08 16:28:33 +00:00
Matan Lurey 497b861187 Add TargetKind.constructor to _DoNotSubmit.
Change-Id: If5ecd6bf015ef6e90761aa5d6d940cd8b021b30d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361280
Auto-Submit: Matan Lurey <matanl@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-04 17:45:01 +00:00
Moritz b321254093 Add @mustBeConst annotation for parameters which should be
constant.

As const-only parameters are not planned, see
https://github.com/dart-lang/language/issues/1684, an annotation with analyzer support could help a bit at least, see
https://github.com/dart-lang/sdk/issues/29381.

The motivation is to enforce const arguments for methods annotated with
`@ResourceIdentifier`, to be able to record the argument values at build time, see https://dart-review.googlesource.com/c/sdk/+/329961.

Tested: pkg/analyzer/test/src/diagnostics/const_argument_test.dart
Change-Id: I2b8d2dce0c899fc0caa4985d892a5d031c747521
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357701
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
2024-04-04 15:22:31 +00:00
Sam Rawlins 9680d387ec meta: Add TargetKind.enumValue
In
[the spec](https://github.com/dart-lang/language/blob/main/accepted/2.17/enhanced-enums/feature-specification.md),
these are referred to as "values", so I went with that wording here. In
the analyzer, I found one case where we call them the "constants"
(EnumDeclaration.constants). I'd prefer to stick with the more common
term, "values."

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

Change-Id: I3ea4650fdeb15d3d23fb7ca42bcf6e0ec0e511f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-03 18:20:59 +00:00
Sam Rawlins c9474ebaaa meta: Introduce TargetKind.directive
Fixes https://github.com/dart-lang/sdk/issues/52274

Change-Id: I67884caf86502d4edd848eb32a30097488e09db9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-04-02 17:29:29 +00:00
Matan Lurey a7c57c327c Initial implementation and tests of @doNotSubmit.
This is my first time contributing something like this, so I mostly went with my gut and tried to refer to similar annotations and diagnostics.

Happy to make adjustments.

R=pquitslund@google.com,brianwilkerson@google.com
CC=​yjbanov@google.com

Bug: https://github.com/dart-lang/sdk/issues/28113
Change-Id: I628311ed99f62b04c37bd1e0ec82ae0b1652d7f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360481
Commit-Queue: Matan Lurey <matanl@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-04-02 05:09:31 +00:00
Sam Rawlins cd90f27317 meta: Introduce TargetKind.constructor
Fixes https://github.com/dart-lang/sdk/issues/47421

Doc nits while I was looking:

* wrap CHANGELOG to 80 characters
* correct docs on field, getter, method, parameter, setter, typedef,
  type parameter,

Change-Id: I97476e08b6773be53dbce190007443f22626d498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360124
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-29 19:15:40 +00:00
Sam Rawlins a70ee07cc2 Add TargetKind.typeParameter
Fixes https://github.com/dart-lang/sdk/issues/49796

Change-Id: I434c3bba20cbcf26177db4f0dc199bb696ab04de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-03-29 06:40:43 +00:00
Moritz f1c285937a Fix metadata for @ResourceIdentifier annotation
The annotation takes metadata of type `Object?`, to allow for custom
data such as strings, ints, double, or bool. The parser, however,
assumed only strings.

Tested:pkg/vm/test/transformations/resource_identifier_test.dart
Change-Id: If813b2b0e5f002306bcfa6eb6195a666d1a72972
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355922
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
2024-03-11 17:08:24 +00:00
Parker Lougheed bcfab01e87 [meta] Cleanup API docs and clarify superseded annotation status
This CL standardizes some comment formats, adds a few missing doc comments, and updates a few others.

It also adds text to a few annotations indicating they are likely to be deprecated in a future release and what the migration path is.

Contributes to https://github.com/dart-lang/sdk/issues/54389

Change-Id: I4fc6d9767378b855a1ab2a1978747fbe18850605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342281
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-10 02:10:36 +00:00
pq b17d4cb14b Fix a few typos
Change-Id: I461ea0c88c257c630577d21bd94c08a3fadb3ade
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341384
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-12-12 19:16:13 +00:00
Moritz a3568286ff Adding the resource-identifier functionality from the compiler to the
vm.

This identifies all calls to static methods annotated with
`@ResourceIdentifier`, collects the constant arguments passed to the
method, and writes the results into a file.

The purpose of this feature is to be able to pass the recorded
information to packages in a post-compilation step, allowing them to
remove or modify assets based on the actual usage in the code prior to
bundling in the final application.

Tested: pkg/vm/test/transformations/resource_identifier_test.dart
Change-Id: I58cb313b66ee23c1d154dcc242547723a1ced359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329961
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2023-11-21 15:05:35 +00:00
pq f962700302 + flutter_style_todos
Enabled `flutter_style_todos` in analyzer packages:

* `analyzer_cli`
* `analyzer_plugin`
* `analyzer_utilities`
* `meta`


Change-Id: I5fcd76bfa5a3bdeb14d6a81b8193129c6d83d0e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335405
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-11-13 00:14:09 +00:00
pq 8a5ddecfb3 + extension type target kind (and @optionalTypeArgs support)
Adds a new TargetKind for extension types and adds it to `@optionalTypeArgs`.

Change-Id: I7254c1299c296451b9adc5d1f8eceb50af66f039
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324769
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-09-08 18:09:01 +00:00
pq 813339e28a refactor TargetKind enum to class
A trimmed down version of https://dart-review.git.corp.google.com/c/sdk/+/258200 which was reverted (https://dart-review.git.corp.google.com/c/sdk/+/268380) for (undiagnosed) performance reasons.

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


Change-Id: Iecd00a4483a4b6904b8b281eec49228620e1e943
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322981
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-28 23:09:27 +00:00
pq 98070ec188 Add @redeclare
See: https://github.com/dart-lang/sdk/issues/53121

Change-Id: I812bc49b58cdf15e9c0c8bcc62a846b51f5dff70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319100
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-08-09 16:59:00 +00:00
pq eb2af1a41a +implicit_reopen link
Change-Id: I7e4468ab77b86437bd0483698cf2be873b9f57c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/319002
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-08-09 15:43:19 +00:00
pq dfe1093849 meta 1.9.1
Fixes: https://github.com/dart-lang/sdk/issues/51059

Change-Id: I7f28741ad0d1507cc1140da6c7c0bccb31d6946b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/290604
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-03-22 20:58:58 +00:00
pq 4c7e87888d update @reopendocs
Fixes: https://dart-review.googlesource.com/c/sdk/+/286860

Feedback welcome. I expect we'll want to iterate more on this but I see Erik's new content as a distinct improvement.


Change-Id: Iba385be6c411f2e5e3f1bd490b437dbea86e07aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286860
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-03-07 21:21:01 +00:00
Josh Soref 77978889eb Spelling
Closes https://github.com/dart-lang/sdk/pull/51143

GitOrigin-RevId: 9e21c99a222d588e4fc95980725a2f8c9784965c
Change-Id: If0870e8936c7649935dce7e23cd783d62aa5610c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279916
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-01-30 18:29:59 +00:00
Sam Rawlins b1525bcf19 Deprecate alwaysThrows
Fixes https://github.com/dart-lang/sdk/issues/49583

Change-Id: Icc10dbba642703098708202537c733ff1d48b9db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279651
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2023-01-26 16:42:08 +00:00
pq c8df5570bc + @reopen
See: https://github.com/dart-lang/sdk/issues/50977

Change-Id: I8bc6547a3f5e2cf4bb8913b1d6dfb8a618fc2022
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278888
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-01-23 21:33:53 +00:00