-
Notifications
You must be signed in to change notification settings - Fork 217
Closed
Labels
small-featureA small feature which is relatively cheap to implement.A small feature which is relatively cheap to implement.

Description
Feature specification: https://github.com/dart-lang/language/blob/master/accepted/2.14/small-features-21Q1/feature-specification.md
Annotations (metadata) aren't allowed to use type arguments, but it is allowed to make annotations using a const of a type that takes a type argument:
class MyAnnotation<T> {
const MyAnnotation();
}
const MA = MyAnnotation<String Function(int)>();
@MA // <- Works.
random(int weather) => '7';
@MyAnnotation<String Function(int)>() // <- Fails.
alsoRandom(int lucky) => '7';
main() => random(0) + alsoRandom(13);
Gives:
../../annotation_type_generic.dart:10:14: Error: An annotation (metadata) can't use type arguments.
@MyAnnotation<String Function(int)>()
^
See also: dart-lang/sdk#44120
greglittlefield-wf, kevmoo, jodinathan, ykmnkmi, hunter-kaan and 8 morerockyoung
Metadata
Metadata
Assignees
Labels
small-featureA small feature which is relatively cheap to implement.A small feature which is relatively cheap to implement.
Type
Projects
Status
Done