TypeScript/tests/baselines/reference/innerOverloads.types

31 lines
1.3 KiB
Text
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/innerOverloads.ts ===
function outer() {
>outer : () => any, Symbol(outer,Decl(innerOverloads.ts,0,0))
2014-08-15 23:33:16 +02:00
function inner(x:number); // should work
>inner : { (x: number): any; (x: string): any; }, Symbol(inner,Decl(innerOverloads.ts,1,18),Decl(innerOverloads.ts,2,29),Decl(innerOverloads.ts,3,29))
>x : number, Symbol(x,Decl(innerOverloads.ts,2,19))
2014-08-15 23:33:16 +02:00
function inner(x:string);
>inner : { (x: number): any; (x: string): any; }, Symbol(inner,Decl(innerOverloads.ts,1,18),Decl(innerOverloads.ts,2,29),Decl(innerOverloads.ts,3,29))
>x : string, Symbol(x,Decl(innerOverloads.ts,3,19))
2014-08-15 23:33:16 +02:00
function inner(a:any) { return a; }
>inner : { (x: number): any; (x: string): any; }, Symbol(inner,Decl(innerOverloads.ts,1,18),Decl(innerOverloads.ts,2,29),Decl(innerOverloads.ts,3,29))
>a : any, Symbol(a,Decl(innerOverloads.ts,4,19))
>a : any, Symbol(a,Decl(innerOverloads.ts,4,19))
2014-08-15 23:33:16 +02:00
return inner(0);
>inner(0) : any
>inner : { (x: number): any; (x: string): any; }, Symbol(inner,Decl(innerOverloads.ts,1,18),Decl(innerOverloads.ts,2,29),Decl(innerOverloads.ts,3,29))
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
}
var x = outer(); // should work
>x : any, Symbol(x,Decl(innerOverloads.ts,9,3))
2014-08-15 23:33:16 +02:00
>outer() : any
>outer : () => any, Symbol(outer,Decl(innerOverloads.ts,0,0))
2014-08-15 23:33:16 +02:00