inheritance property

List<InheritingContainer> inheritance

Implementation

List<InheritingContainer> get inheritance {
  var inheritance = <InheritingContainer>[];
  inheritance
      .addAll((enclosingElement as InheritingContainer).inheritanceChain);
  var object = packageGraph.specialClasses[SpecialClass.object];
  if (!inheritance.contains(definingEnclosingContainer) &&
      definingEnclosingContainer != null) {
    assert(definingEnclosingContainer == object);
  }
  // Unless the code explicitly extends dart-core's Object, we won't get
  // an entry here.  So add it.
  if (inheritance.last != object && object != null) {
    inheritance.add(object);
  }
  assert(inheritance.where((e) => e == object).length == 1);
  return inheritance;
}