1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
=== tests/cases/compiler/overloadWithCallbacksWithDifferingOptionalityOnArgs.ts ===
function x2(callback: (x?: number) => number);
>x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; }
>callback : (x?: number) => number
>x : number
function x2(callback: (x: string) => number);
>x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; }
>callback : (x: string) => number
>x : string
function x2(callback: (x: any) => number) { }
>x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; }
>callback : (x: any) => number
>x : any
x2(() => 1);
>x2(() => 1) : any
>x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; }
>() => 1 : () => number
>1 : 1
x2((x) => 1 );
>x2((x) => 1 ) : any
>x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; }
>(x) => 1 : (x: number) => number
>x : number
>1 : 1
|