isBoundSupertypeTo method

  1. @override
bool isBoundSupertypeTo(
  1. ElementType t

Returns true if at least one supertype (including via mixins and interfaces) is equivalent to or a subtype of this when instantiated to bounds.


bool isBoundSupertypeTo(ElementType t) {
  var type = t.instantiatedType;
  if (type is InterfaceType) {
    var superTypes = type.allSupertypes;
    for (var superType in superTypes) {
      if (library.typeSystem.isSubtypeOf(superType, instantiatedType)) {
        return true;
  return false;