code: void expectSuperType(Node n, ObjectType superObject, ObjectType subObject) {
      FunctionType subCtor = subObject.getConstructor();
      ObjectType implicitProto = subObject.getImplicitPrototype();
      ObjectType declaredSuper =
          implicitProto == null ? null : implicitProto.getImplicitPrototype();
      if (declaredSuper != null && declaredSuper.isTemplatizedType()) {
        declaredSuper =
            declaredSuper.toMaybeTemplatizedType().getReferencedType();
      }
      if (declaredSuper != null
          && !(superObject instanceof UnknownType)
          && !declaredSuper.isEquivalentTo(superObject)) {
        if (declaredSuper.isEquivalentTo(getNativeType(OBJECT_TYPE))) {
          registerMismatch(
              superObject,
              declaredSuper,
              report(JSError.make(n, MISSING_EXTENDS_TAG_WARNING, subObject.toString())));
        } else {
          mismatch(n, "mismatch in declaration of superclass type", superObject, declaredSuper);
        }
  
        // Correct the super type.
        if (!subCtor.hasCachedValues()) {
          subCtor.setPrototypeBasedOn(superObject);
        }
      }
    }
docs: Expect that the first type is the direct superclass of the second type.
  
  @param t The node traversal.
  @param n The node where warnings should point to.
  @param superObject The expected super instance type.
  @param subObject The sub instance type.