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

Function isImplementationOfOverload

test/fixtures/snapshot/typescript.js:86973–86994  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

86971 return false;
86972 }
86973 function isImplementationOfOverload(node) {
86974 if (ts.nodeIsPresent(node.body)) {
86975 if (ts.isGetAccessor(node) || ts.isSetAccessor(node))
86976 return false; // Get or set accessors can never be overload implementations, but can have up to 2 signatures
86977 var symbol = getSymbolOfNode(node);
86978 var signaturesOfSymbol = getSignaturesOfSymbol(symbol);
86979 // If this function body corresponds to function with multiple signature, it is implementation of overload
86980 // e.g.: function foo(a: string): string;
86981 // function foo(a: number): number;
86982 // function foo(a: any) { // This is implementation of the overloads
86983 // return a;
86984 // }
86985 return signaturesOfSymbol.length > 1 ||
86986 // If there is single signature for the symbol, it is overload if that signature isn't coming from the node
86987 // e.g.: function foo(a: string): string;
86988 // function foo(a: any) { // This is implementation of the overloads
86989 // return a;
86990 // }
86991 (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node);
86992 }
86993 return false;
86994 }
86995 function isRequiredInitializedParameter(parameter) {
86996 return !!strictNullChecks &&
86997 !isOptionalParameter(parameter) &&

Callers 1

createTypeCheckerFunction · 0.85

Calls 2

getSymbolOfNodeFunction · 0.85
getSignaturesOfSymbolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…