Commit Graph

113 Commits

Author SHA1 Message Date
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
Samuel Rawlins 813ca7faf6 Revert "[analyzer][meta] Refactor TargetKind to be a class, add a value in TargetKind to represent type parameter"
This reverts commit 82143e6c95.

Reason for revert: This commit appears to have negatively affected the analyze benchmark:

* https://golem.corp.goog/Revision?repository=flutter-analyze&team=dartanalyzer&revision=114193

We need to revert and analyze it.

Original change's description:
> [analyzer][meta] Refactor TargetKind to be a class, add a value in TargetKind to represent type parameter
>
> Bug: https://github.com/dart-lang/sdk/issues/49796
> Change-Id: Ide144ceb57bae94a71b9d1a7ec841d03363fc121
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258200
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/49796
Change-Id: I6ec04ffe8d85c417d138626ffa4f1a7ac7dafe2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-11-07 20:17:09 +00:00
Mateus Felipe C. C. Pinto 82143e6c95 [analyzer][meta] Refactor TargetKind to be a class, add a value in TargetKind to represent type parameter
Bug: https://github.com/dart-lang/sdk/issues/49796
Change-Id: Ide144ceb57bae94a71b9d1a7ec841d03363fc121
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258200
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-11-04 23:38:40 +00:00
Sam Rawlins d77ded508e Report invalid mustCallSuper annotation targets
Fixes https://github.com/dart-lang/sdk/issues/49499

Change-Id: Ibea55a78b58ee83b9290c33bca5e69039c995d55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252865
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-07-28 17:48:15 +00:00
Sam Rawlins aee2e21de8 Correct mustCallSuper documentation as per analyzer impl
See must_call_super_test.dart for tests covered by this documentation.

Bug: https://github.com/dart-lang/sdk/issues/49499
Change-Id: I50e6546dda155cb133b8ad314db27a266a94fa00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-07-27 00:58:37 +00:00
Sam Rawlins 7280525117 Implement mustBeOverridden annotation and enforcement
Fixes https://github.com/dart-lang/sdk/issues/30175
Fixes https://github.com/dart-lang/sdk/issues/28250

Change-Id: Id9c62448da9ade81258c2ae2355d05117057a8f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252463
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-07-25 22:17:18 +00:00
Devon Carew 580597c2eb [pkg/meta] analyze using package:lints
Change-Id: Ie490a992eac0f8b6e784346c67c8c297e9d1d034
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250773
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-07-06 22:24:20 +00:00
Marc Plano-Lesay 9d68fe751d Fix a typo
Closes https://github.com/dart-lang/sdk/pull/47817
https://github.com/dart-lang/sdk/pull/47817

GitOrigin-RevId: a7bbf4d895136b4c304cc11dd2e83aa4f208be51
Change-Id: Ib60bfc53d77532ff782ba732a282f4c2a61d293a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221746
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2021-12-02 11:37:31 +00:00
Stephen Adams 55596f4c01 [dart2js] Implement package:meta/dart2js.dart in terms of @pragma
Change-Id: I56777498f3c3b6f910eb8c7e066de4fc254c1708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2021-08-16 18:02:39 +00:00
pq 9491cafc2f add UseResult.unless({... , this.parameterDefined});
Sample use:

```
@UseResult.unless(parameterDefined: 'count')
Matcher hasCount([int? count]) => Matcher();
```

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


Change-Id: I507659c09072157d67433f347d1fa6b511a93a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208721
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-08-04 14:30:10 +00:00
Konstantin Shcheglov 0f2e58367d Prepare to publish meta 2.0.0
Adding any not private extension is a breaking change.
So, to add `TargetKindExtension` we need version `2.0.0`.

Bug: https://github.com/dart-lang/sdk/issues/46558
Change-Id: Ic23c95490f12805784460c40013711e9d99dbf23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205905
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-03 01:22:45 +00:00
Konstantin Shcheglov a6c37854f5 Prepare to publish meta 1.6.0
Revert "Move TargetKind.displayString from analyzer to meta"

This reverts commit 6de639b71f.

Change-Id: Ie4bec18dbc22db81ddec50eb36f47282e8a0a7ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205904
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-07-03 00:00:05 +00:00
Sam Rawlins 9f85dc07a7 Improve quality of @protected doc comment
Fixes https://github.com/dart-lang/sdk/issues/29804

Start doc comment with a single-sentence summary.
https://dart.dev/guides/language/effective-dart/documentation#do-start-doc-comments-with-a-single-sentence-summary

Separate the first sentence of a doc comment into its own paragraph.
https://dart.dev/guides/language/effective-dart/documentation#do-separate-the-first-sentence-of-a-doc-comment-into-its-own-paragraph

Replace text which refers to "using" an "invocation" of a member with text which refers to "referencing" a member.

Explicitly call out mixins and superclass constraints.

Improve language around using "this" as a receiver.

Attempt to use more straightfoward sentences.

Change-Id: Ib465b640c217d3759455611116aef0545b5665fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201445
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-05-27 18:41:24 +00:00