docs: function getContextualSignature(node) {
              ts.Debug.assert(node.kind !== 147 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node));
              var type = getContextualTypeForFunctionLikeDeclaration(node);
              if (!type) {
                  return undefined;
              }
              if (!(type.flags & 524288 /* Union */)) {
                  return getNonGenericSignature(type);
              }
              var signatureList;
              var types = type.types;
              for (var _i = 0, types_12 = types; _i < types_12.length; _i++) {
                  var current = types_12[_i];
                  var signature = getNonGenericSignature(current);
                  if (signature) {
                      if (!signatureList) {
                          // This signature will contribute to contextual union signature
                          signatureList = [signature];
                      }
                      else if (!compareSignaturesIdentical(signatureList[0], signature, /*partialMatch*/ false, /*ignoreThisTypes*/ true, /*ignoreReturnTypes*/ true, compareTypesIdentical)) {
                          // Signatures aren't identical, do not use
                          return undefined;
                      }
                      else {
                          // Use this signature for contextual union signature
                          signatureList.push(signature);
                      }
                  }
              }
              // Result is union of signatures collected (return type is union of return types of this signature set)
              var result;
              if (signatureList) {
                  result = cloneSignature(signatureList[0]);
                  // Clear resolved return type we possibly got from cloneSignature
                  result.resolvedReturnType = undefined;
                  result.unionSignatures = signatureList;
              }
              return result;
          }