code: FunctionTypeBuilder inferTemplateTypeName(@Nullable JSDocInfo info, @Nullable JSType ownerType) {
      // NOTE: these template type names may override a list
      // of inherited ones from an overridden function.
  
      if (info != null && !maybeUseNativeClassTemplateNames(info)) {
        ImmutableList<TemplateType> templates =
            buildTemplateTypesFromJSDocInfo(info, !(isConstructor || isInterface));
        if (!templates.isEmpty()) {
          this.templateTypeNames = templates;
        }
      }
  
      ImmutableList<TemplateType> ownerTypeKeys =
          ownerType != null ? ownerType.getTemplateTypeMap().getTemplateKeys() : ImmutableList.of();
  
      if (!templateTypeNames.isEmpty() || !ownerTypeKeys.isEmpty()) {
        // TODO(sdh): The order of these should be switched to avoid class templates shadowing
        // method templates, but this currently loosens type checking of arrays more than we'd like.
        // See http://github.com/google/closure-compiler/issues/2973
        registerTemplates(
            Iterables.concat(templateTypeNames, ownerTypeKeys), contents.getSourceNode());
      }
  
      return this;
    }
docs: Infer the template type from the doc info.