TypeScript/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types

80 lines
2.7 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/overloadResolutionOverNonCTLambdas.ts ===
module Bugs {
>Bugs : typeof Bugs
2014-08-15 23:33:16 +02:00
class A {
>A : A
2014-08-15 23:33:16 +02:00
}
// replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string;
function bug2(message:string, ...args:any[]):string {
>bug2 : (message: string, ...args: any[]) => string
>message : string
>args : any[]
2014-08-15 23:33:16 +02:00
var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) {
>result : string
2014-08-22 03:39:46 +02:00
>message.replace(/\{(\d+)\}/g, function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; }) : string
>message.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }
>message : string
>replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; }
2015-04-13 21:36:11 +02:00
>/\{(\d+)\}/g : RegExp
2014-08-22 03:39:46 +02:00
>function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; } : (match: string, ...rest: any[]) => any
>match : string
>rest : any[]
2014-08-15 23:33:16 +02:00
var index= rest[0];
>index : any
2014-08-15 23:33:16 +02:00
>rest[0] : any
>rest : any[]
2015-04-13 21:36:11 +02:00
>0 : number
2014-08-15 23:33:16 +02:00
return typeof args[index] !== 'undefined'
2014-08-22 03:39:46 +02:00
>typeof args[index] !== 'undefined' ? args[index] : match : any
2014-08-15 23:33:16 +02:00
>typeof args[index] !== 'undefined' : boolean
>typeof args[index] : string
>args[index] : any
>args : any[]
>index : any
2015-04-13 21:36:11 +02:00
>'undefined' : string
2014-08-15 23:33:16 +02:00
? args[index]
>args[index] : any
>args : any[]
>index : any
2014-08-15 23:33:16 +02:00
: match;
>match : string
2014-08-15 23:33:16 +02:00
});
return result;
>result : string
2014-08-15 23:33:16 +02:00
}
}
function bug3(f:(x:string)=>string) { return f("s") }
>bug3 : (f: (x: string) => string) => string
>f : (x: string) => string
>x : string
2014-08-15 23:33:16 +02:00
>f("s") : string
>f : (x: string) => string
2015-04-13 21:36:11 +02:00
>"s" : string
2014-08-15 23:33:16 +02:00
function fprime(x:string):string { return x; }
>fprime : (x: string) => string
>x : string
>x : string
2014-08-15 23:33:16 +02:00
bug3(fprime);
>bug3(fprime) : string
>bug3 : (f: (x: string) => string) => string
>fprime : (x: string) => string
2014-08-15 23:33:16 +02:00
bug3(function(x:string):string { return x; });
>bug3(function(x:string):string { return x; }) : string
>bug3 : (f: (x: string) => string) => string
2014-08-15 23:33:16 +02:00
>function(x:string):string { return x; } : (x: string) => string
>x : string
>x : string
2014-08-15 23:33:16 +02:00