function _validateMethodImplementation()

in src/validator.ts [245:268]


    function _validateMethodImplementation(method: spec.Method, type: spec.ClassType | spec.InterfaceType): boolean {
      if (!type.interfaces) {
        // Abstract classes may not directly implement all members, need to check their supertypes...
        if (spec.isClassType(type) && type.base && type.abstract) {
          return _validateMethodImplementation(method, _dereference(type.base, assembly, validator) as spec.ClassType);
        }
        return false;
      }
      for (const iface of type.interfaces) {
        const ifaceType = _dereference(iface, assembly, validator) as spec.InterfaceType;
        const implemented = (ifaceType.methods ?? []).find((m) => m.name === method.name);
        if (implemented) {
          _assertSignaturesMatch(implemented, method, `${type.fqn}#${method.name}`, `implementing ${ifaceType.fqn}`);
          // We won't replace a previous overrides declaration from a method override, as those have
          // higher precedence than an initial implementation.
          method.overrides = method.overrides ?? iface;
          return true;
        }
        if (_validateMethodImplementation(method, ifaceType)) {
          return true;
        }
      }
      return false;
    }