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

Function isImplementationCompatibleWithOverload

test/fixtures/snapshot/typescript.js:64484–64496  ·  view source on GitHub ↗
(implementation, overload)

Source from the content-addressed store, hash-verified

64482 return related;
64483 }
64484 function isImplementationCompatibleWithOverload(implementation, overload) {
64485 var erasedSource = getErasedSignature(implementation);
64486 var erasedTarget = getErasedSignature(overload);
64487 // First see if the return types are compatible in either direction.
64488 var sourceReturnType = getReturnTypeOfSignature(erasedSource);
64489 var targetReturnType = getReturnTypeOfSignature(erasedTarget);
64490 if (targetReturnType === voidType
64491 || isTypeRelatedTo(targetReturnType, sourceReturnType, assignableRelation)
64492 || isTypeRelatedTo(sourceReturnType, targetReturnType, assignableRelation)) {
64493 return isSignatureAssignableTo(erasedSource, erasedTarget, /*ignoreReturnTypes*/ true);
64494 }
64495 return false;
64496 }
64497 function isEmptyResolvedType(t) {
64498 return t !== anyFunctionType &&
64499 t.properties.length === 0 &&

Calls 4

getErasedSignatureFunction · 0.85
getReturnTypeOfSignatureFunction · 0.85
isTypeRelatedToFunction · 0.85
isSignatureAssignableToFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…