Files
tsgo/testdata/baselines/reference/submodule/compiler/conditionallyDuplicateOverloadsCausedByOverloadResolution.errors.txt

26 lines
946 B
Plaintext

conditionallyDuplicateOverloadsCausedByOverloadResolution.ts(19,12): error TS2454: Variable 'bar' is used before being assigned.
==== conditionallyDuplicateOverloadsCausedByOverloadResolution.ts (1 errors) ====
declare function foo(func: (x: string, y: string) => any): boolean;
declare function foo(func: (x: string, y: number) => any): string;
var out = foo((x, y) => {
function bar(a: typeof x): void;
function bar(b: typeof y): void;
function bar() { }
return bar;
});
declare function foo2(func: (x: string, y: string) => any): boolean;
declare function foo2(func: (x: string, y: number) => any): string;
var out2 = foo2((x, y) => {
var bar: {
(a: typeof x): void;
(b: typeof y): void;
};
return bar;
~~~
!!! error TS2454: Variable 'bar' is used before being assigned.
});