superinterfaces property

  1. @override
List<ClassMirror> get superinterfaces
inherited

A list of mirrors on the superinterfaces of the reflectee.

Required capabilities: superinterfaces requires a TypeRelationsCapability.

Implementation

@override
List<ClassMirror> get superinterfaces {
  if (_superinterfaceIndices.length == 1 &&
      _superinterfaceIndices[0] == noCapabilityIndex) {
    throw NoSuchCapabilityError(
      'Requesting `superinterfaces` of `$qualifiedName` '
      'without `typeRelationsCapability`',
    );
  }
  return _superinterfaceIndices.map<ClassMirror>((int i) {
    if (i == noCapabilityIndex) {
      // When we have a list of superinterfaces which is not a list
      // containing just the single element [noCapabilityIndex] then
      // we do have the `typeRelationsCapability`, but we may still
      // encounter a single unsupported superinterface.
      throw NoSuchCapabilityError(
        'Requesting a superinterface of `$qualifiedName` '
        'without capability',
      );
    }
    return _data.typeMirrors[i] as ClassMirror;
  }).toList();
}