resolveFieldAnnotationsIncludingSuper<T> function

List<T> resolveFieldAnnotationsIncludingSuper<T>(
  1. $AFld field
)

Implementation

List<T> resolveFieldAnnotationsIncludingSuper<T>($AFld field) {
  List<T> out = <T>[];
  Set<String> seen = <String>{};

  void addAll(Iterable<T> values) {
    for (T value in values) {
      String key = '${value.runtimeType}:${value.hashCode}';
      if (!seen.add(key)) {
        continue;
      }
      out.add(value);
    }
  }

  addAll(field.annotations.whereType<T>());
  for ($AFld inherited in _inheritedFieldsByName(field)) {
    addAll(inherited.annotations.whereType<T>());
  }

  return out;
}