2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/overloadResolutionWithAny.ts ===
|
|
|
|
var func: {
|
2015-04-13 23:01:57 +02:00
|
|
|
>func : { (s: string): number; (s: any): string; }, Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
(s: string): number;
|
2015-04-13 23:01:57 +02:00
|
|
|
>s : string, Symbol(s, Decl(overloadResolutionWithAny.ts, 1, 5))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
(s: any): string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>s : any, Symbol(s, Decl(overloadResolutionWithAny.ts, 2, 5))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
func(""); // number
|
|
|
|
>func("") : number
|
2015-04-13 23:01:57 +02:00
|
|
|
>func : { (s: string): number; (s: any): string; }, Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
func(3); // string
|
|
|
|
>func(3) : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>func : { (s: string): number; (s: any): string; }, Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>3 : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x: any;
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : any, Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
func(x); // string
|
|
|
|
>func(x) : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>func : { (s: string): number; (s: any): string; }, Symbol(func, Decl(overloadResolutionWithAny.ts, 0, 3))
|
|
|
|
>x : any, Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var func2: {
|
2015-04-13 23:01:57 +02:00
|
|
|
>func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; }, Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
(s: string, t: string): number;
|
2015-04-13 23:01:57 +02:00
|
|
|
>s : string, Symbol(s, Decl(overloadResolutionWithAny.ts, 11, 5))
|
|
|
|
>t : string, Symbol(t, Decl(overloadResolutionWithAny.ts, 11, 15))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
(s: any, t: string): boolean;
|
2015-04-13 23:01:57 +02:00
|
|
|
>s : any, Symbol(s, Decl(overloadResolutionWithAny.ts, 12, 5))
|
|
|
|
>t : string, Symbol(t, Decl(overloadResolutionWithAny.ts, 12, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
(s: string, t: any): RegExp;
|
2015-04-13 23:01:57 +02:00
|
|
|
>s : string, Symbol(s, Decl(overloadResolutionWithAny.ts, 13, 5))
|
|
|
|
>t : any, Symbol(t, Decl(overloadResolutionWithAny.ts, 13, 15))
|
|
|
|
>RegExp : RegExp, Symbol(RegExp, Decl(lib.d.ts, 825, 1), Decl(lib.d.ts, 876, 11))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
(s: any, t: any): string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>s : any, Symbol(s, Decl(overloadResolutionWithAny.ts, 14, 5))
|
|
|
|
>t : any, Symbol(t, Decl(overloadResolutionWithAny.ts, 14, 12))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func2(x, x); // string
|
|
|
|
>func2(x, x) : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; }, Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3))
|
|
|
|
>x : any, Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3))
|
|
|
|
>x : any, Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
func2("", ""); // number
|
|
|
|
>func2("", "") : number
|
2015-04-13 23:01:57 +02:00
|
|
|
>func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; }, Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
|
|
|
>"" : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
func2(x, ""); // boolean
|
|
|
|
>func2(x, "") : boolean
|
2015-04-13 23:01:57 +02:00
|
|
|
>func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; }, Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3))
|
|
|
|
>x : any, Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
func2("", x); // RegExp
|
|
|
|
>func2("", x) : RegExp
|
2015-04-13 23:01:57 +02:00
|
|
|
>func2 : { (s: string, t: string): number; (s: any, t: string): boolean; (s: string, t: any): RegExp; (s: any, t: any): string; }, Symbol(func2, Decl(overloadResolutionWithAny.ts, 10, 3))
|
2015-04-13 21:36:11 +02:00
|
|
|
>"" : string
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : any, Symbol(x, Decl(overloadResolutionWithAny.ts, 7, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|