mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
946 B
Plaintext
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.
|
|
}); |