src/com/google/javascript/jscomp/TypeValidator.java
/**
   * 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.
   */
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.
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 .
void expectExtends(Node n, FunctionType subCtor, FunctionType astSuperCtor) {
    if (astSuperCtor == null || (!astSuperCtor.isConstructor() && !astSuperCtor.isInterface())) {
      return;
    }
    if (astSuperCtor.isConstructor() != subCtor.isConstructor()) {
      return;
    }
    ObjectType astSuperInstance = astSuperCtor.getInstanceType();
    if (subCtor.isConstructor()) {
      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()) {
    }
  }
void expectExtends ( Node n , FunctionType subCtor , FunctionType astSuperCtor ) { if ( astSuperCtor == null || ( ! astSuperCtor . isConstructor ( ) && ! astSuperCtor . isInterface ( ) ) ) { return ; } if ( astSuperCtor . isConstructor ( ) != subCtor . isConstructor ( ) ) { return ; } ObjectType astSuperInstance = astSuperCtor . getInstanceType ( ) ; if ( subCtor . isConstructor ( ) ) { 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 ( ) ) { } }
Expect that an ES6 class's extends clause is actually a supertype of the given class.
Expect that an ES6 class ' s extends clause is actually a supertype of the given class .
// toMaybeFunctionType failed, or we've got a loose type.  Let it go for now. // Don't bother looking if one is a constructor and the other is an interface. // We'll report an error elsewhere. // 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. // We intentionally skip this check for interfaces because they can extend multiple other // interfaces.