2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/innerOverloads.ts ===
|
|
|
|
|
|
|
|
function outer() {
|
2015-04-13 22:54:22 +02:00
|
|
|
>outer : () => any, Symbol(outer,Decl(innerOverloads.ts,0,0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function inner(x:number); // should work
|
2015-04-13 22:54:22 +02:00
|
|
|
>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);
|
2015-04-13 22:54:22 +02:00
|
|
|
>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; }
|
2015-04-13 22:54:22 +02:00
|
|
|
>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
|
2015-04-13 22:54:22 +02:00
|
|
|
>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
|
2015-04-13 22:54:22 +02:00
|
|
|
>x : any, Symbol(x,Decl(innerOverloads.ts,9,3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>outer() : any
|
2015-04-13 22:54:22 +02:00
|
|
|
>outer : () => any, Symbol(outer,Decl(innerOverloads.ts,0,0))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
|