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>
diff --git a/pkg/meta/lib/meta_meta.dart b/pkg/meta/lib/meta_meta.dart
index 0766c1b..62fc36c 100644
--- a/pkg/meta/lib/meta_meta.dart
+++ b/pkg/meta/lib/meta_meta.dart
@@ -77,7 +77,7 @@
static const mixinType = TargetKind._('mixins', 'mixinType');
/// Indicates that an annotation is valid on any formal parameter declaration,
- /// whether it's in a function, method, constructor, or closure.
+ /// whether it's in a function (named or anonymous), method, or constructor.
static const parameter = TargetKind._('parameters', 'parameter');
/// Indicates that an annotation is valid on any setter declaration, both
@@ -99,6 +99,12 @@
/// Indicates that an annotation is valid on any typedef declaration.`
static const typedefType = TargetKind._('typedefs', 'typedefType');
+ /// Indicates that an annotation is valid on any type parameter declaration,
+ /// whether it's on a class, enum, function type, function, mixin, extension,
+ /// extension type, or typedef.
+ static const typeParameter = TargetKind._(
+ 'type parameters (classes, enums, mixins, or typedefs)', 'typeParameter');
+
/// All current [TargetKind] values of targets to
/// which an annotation can be applied.
static const values = [
@@ -116,6 +122,7 @@
setter,
topLevelVariable,
type,
+ typeParameter,
typedefType,
];