MCPcopy Index your code
hub / github.com/nodejs/node / inferFromSignature

Function inferFromSignature

test/fixtures/snapshot/typescript.js:69051–69061  ·  view source on GitHub ↗
(source, target, skipParameters)

Source from the content-addressed store, hash-verified

69049 }
69050 }
69051 function inferFromSignature(source, target, skipParameters) {
69052 if (!skipParameters) {
69053 var saveBivariant = bivariant;
69054 var kind = target.declaration ? target.declaration.kind : 0 /* SyntaxKind.Unknown */;
69055 // Once we descend into a bivariant signature we remain bivariant for all nested inferences
69056 bivariant = bivariant || kind === 169 /* SyntaxKind.MethodDeclaration */ || kind === 168 /* SyntaxKind.MethodSignature */ || kind === 171 /* SyntaxKind.Constructor */;
69057 applyToParameterTypes(source, target, inferFromContravariantTypes);
69058 bivariant = saveBivariant;
69059 }
69060 applyToReturnTypes(source, target, inferFromTypes);
69061 }
69062 function inferFromIndexTypes(source, target) {
69063 // Inferences across mapped type index signatures are pretty much the same a inferences to homomorphic variables
69064 var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32 /* ObjectFlags.Mapped */) ? 8 /* InferencePriority.HomomorphicMappedType */ : 0;

Callers 1

inferFromSignaturesFunction · 0.85

Calls 2

applyToParameterTypesFunction · 0.85
applyToReturnTypesFunction · 0.85

Tested by

no test coverage detected