AnnotationImpl constructor

AnnotationImpl({
  1. required Token atSign,
  2. required IdentifierImpl name,
  3. required TypeArgumentListImpl? typeArguments,
  4. required Token? period,
  5. required SimpleIdentifierImpl? constructorName,
  6. required ArgumentListImpl? arguments,
})

Initialize a newly created annotation. Both the period and the constructorName can be null if the annotation is not referencing a named constructor. The arguments can be null if the annotation is not referencing a constructor.

Note that type arguments are only valid if Feature.generic_metadata is enabled.

Implementation

AnnotationImpl({
  required this.atSign,
  required IdentifierImpl name,
  required TypeArgumentListImpl? typeArguments,
  required this.period,
  required SimpleIdentifierImpl? constructorName,
  required ArgumentListImpl? arguments,
})  : _name = name,
      _typeArguments = typeArguments,
      _constructorName = constructorName,
      _arguments = arguments {
  _becomeParentOf(_name);
  _becomeParentOf(_typeArguments);
  _becomeParentOf(_constructorName);
  _becomeParentOf(_arguments);
}