30 lines
602 B
Text
30 lines
602 B
Text
=== tests/cases/compiler/innerOverloads.ts ===
|
|
|
|
function outer() {
|
|
>outer : () => any
|
|
|
|
function inner(x:number); // should work
|
|
>inner : { (x: number): any; (x: string): any; }
|
|
>x : number
|
|
|
|
function inner(x:string);
|
|
>inner : { (x: number): any; (x: string): any; }
|
|
>x : string
|
|
|
|
function inner(a:any) { return a; }
|
|
>inner : { (x: number): any; (x: string): any; }
|
|
>a : any
|
|
>a : any
|
|
|
|
return inner(0);
|
|
>inner(0) : any
|
|
>inner : { (x: number): any; (x: string): any; }
|
|
>0 : number
|
|
}
|
|
|
|
var x = outer(); // should work
|
|
>x : any
|
|
>outer() : any
|
|
>outer : () => any
|
|
|
|
|