mixin property

  1. @override
ClassMirror get mixin
inherited

The mixin of this class.

If this class is the result of a mixin application of the form S with M, returns a class mirror on M. Otherwise returns a class mirror on reflectee.

Required capabilities: mixin requires a TypeRelationsCapability.

Implementation

@override
ClassMirror get mixin {
  if (_mixinIndex == noCapabilityIndex) {
    if (!_supportsTypeRelations(_reflector)) {
      throw NoSuchCapabilityError(
        'Attempt to get `mixin` for `$qualifiedName` '
        'without `typeRelationsCapability`',
      );
    }
    throw NoSuchCapabilityError(
      'Attempt to get mixin from "$simpleName" without capability',
    );
  }
  return _data.typeMirrors[_mixinIndex] as ClassMirror;
}