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>
This commit is contained in:
Sam Rawlins 2024-04-03 18:20:59 +00:00 committed by Commit Queue
parent 260ebec7a0
commit 9680d387ec
2 changed files with 8 additions and 2 deletions

View file

@ -1,11 +1,13 @@
## 1.14.0-wip
- Introduce `TargetKind.constructor`, to indicate that an annotation is valid on
any constructor.
any constructor declaration.
- Introduce `TargetKind.directive`, to indicate that an annotation is valid on
any directive.
- Introduce `TargetKind.enumValue`, to indicate that an annotation is valid on
any enum value declaration.
- Introduce `TargetKind.typeParamteer`, to indicate that an annotation is valid
on any type parameter.
on any type parameter declaration.
- Introduce `@doNotSubmit` to annotate members that should not be submitted to
source control, typically because they are intended to be used ephemerally
during development.

View file

@ -53,6 +53,9 @@ class TargetKind {
/// `part of` directive.
static const directive = TargetKind._('directives', 'directive');
/// Indicates that an annotation is valid on any enum value declaration.
static const enumValue = TargetKind._('enum values', 'enumValue');
/// Indicates that an annotation is valid on any enum declaration.
static const enumType = TargetKind._('enums', 'enumType');
@ -125,6 +128,7 @@ class TargetKind {
classType,
constructor,
directive,
enumValue,
enumType,
extension,
extensionType,