Files
codeql/javascript/ql/test/query-tests/Declarations/DeadStoreOfLocal/overload.ts
2025-02-28 13:27:28 +01:00

17 lines
343 B
TypeScript

export function foo() {
function bar(x: number): number;
function bar(x: string): string;
function bar(x: any) {
return x;
}
function baz(x: number): number;
function baz(x: string): string;
function baz(x: any) { // $ Alert - overwritten before use
return x;
}
baz = (x) => x;
return {bar: bar, baz: baz};
}