code: void expectExtends(Node n, FunctionType subCtor, FunctionType astSuperCtor) {
      if (astSuperCtor == null || (!astSuperCtor.isConstructor() && !astSuperCtor.isInterface())) {
        // toMaybeFunctionType failed, or we've got a loose type.  Let it go for now.
        return;
      }
      if (astSuperCtor.isConstructor() != subCtor.isConstructor()) {
        // Don't bother looking if one is a constructor and the other is an interface.
        // We'll report an error elsewhere.
        return;
      }
      ObjectType astSuperInstance = astSuperCtor.getInstanceType();
      if (subCtor.isConstructor()) {
        // There should be exactly one superclass, and it needs to have this constructor.
        // Note: if the registered supertype (from the @extends jsdoc) was unresolved,
        // then getSuperClassConstructor will be null - make sure not to crash.
        FunctionType registeredSuperCtor = subCtor.getSuperClassConstructor();
        if (registeredSuperCtor != null) {
          ObjectType registeredSuperInstance = registeredSuperCtor.getInstanceType();
          if (!astSuperInstance.isEquivalentTo(registeredSuperInstance)) {
            mismatch(
                n,
                "mismatch in declaration of superclass type",
                astSuperInstance,
                registeredSuperInstance);
          }
        }
      } else if (subCtor.isInterface()) {
        // We intentionally skip this check for interfaces because they can extend multiple other
        // interfaces.
      }
    }
docs: Expect that an ES6 class's extends clause is actually a supertype of the given class.
  Compares the registered supertype, which is taken from the JSDoc if present, otherwise
  from the AST, with the type in the extends node of the AST.
  
  @param n The node where warnings should point to.
  @param subCtor The sub constructor type.
  @param astSuperCtor The expected super constructor from the extends node in the AST.