2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/genericTypeArgumentInference1.ts ===
|
|
|
|
module Underscore {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Underscore : any
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
export interface Iterator<T, U> {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Iterator : Iterator<T, U>
|
|
|
|
>T : T
|
|
|
|
>U : U
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
(value: T, index: any, list: any): U;
|
2015-04-16 01:44:20 +02:00
|
|
|
>value : T
|
|
|
|
>T : T
|
|
|
|
>index : any
|
|
|
|
>list : any
|
|
|
|
>U : U
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
export interface Static {
|
2015-04-16 01:44:20 +02:00
|
|
|
>Static : Static
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
all<T>(list: T[], iterator?: Iterator<T, boolean>, context?: any): T;
|
2015-04-16 01:44:20 +02:00
|
|
|
>all : <T>(list: T[], iterator?: Iterator<T, boolean>, context?: any) => T
|
|
|
|
>T : T
|
|
|
|
>list : T[]
|
|
|
|
>T : T
|
|
|
|
>iterator : Iterator<T, boolean>
|
|
|
|
>Iterator : Iterator<T, U>
|
|
|
|
>T : T
|
|
|
|
>context : any
|
|
|
|
>T : T
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
identity<T>(value: T): T;
|
2015-04-16 01:44:20 +02:00
|
|
|
>identity : <T>(value: T) => T
|
|
|
|
>T : T
|
|
|
|
>value : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
declare var _: Underscore.Static;
|
2015-04-16 01:44:20 +02:00
|
|
|
>_ : Underscore.Static
|
|
|
|
>Underscore : any
|
|
|
|
>Static : Underscore.Static
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r = _.all([true, 1, null, 'yes'], _.identity);
|
2015-04-16 01:44:20 +02:00
|
|
|
>r : string | number | boolean
|
2014-10-08 22:48:44 +02:00
|
|
|
>_.all([true, 1, null, 'yes'], _.identity) : string | number | boolean
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
2014-10-18 01:53:18 +02:00
|
|
|
>[true, 1, null, 'yes'] : (string | number | boolean)[]
|
2015-04-13 21:36:11 +02:00
|
|
|
>true : boolean
|
|
|
|
>1 : number
|
|
|
|
>null : null
|
|
|
|
>'yes' : string
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.identity : <T>(value: T) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>identity : <T>(value: T) => T
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r2 = _.all([true], _.identity);
|
2015-04-16 01:44:20 +02:00
|
|
|
>r2 : boolean
|
2014-08-15 23:33:16 +02:00
|
|
|
>_.all([true], _.identity) : boolean
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
2014-08-15 23:33:16 +02:00
|
|
|
>[true] : boolean[]
|
2015-04-13 21:36:11 +02:00
|
|
|
>true : boolean
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.identity : <T>(value: T) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>identity : <T>(value: T) => T
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r3 = _.all([], _.identity);
|
2015-04-16 01:44:20 +02:00
|
|
|
>r3 : any
|
2014-08-15 23:33:16 +02:00
|
|
|
>_.all([], _.identity) : any
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
2014-10-13 15:56:58 +02:00
|
|
|
>[] : undefined[]
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.identity : <T>(value: T) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>identity : <T>(value: T) => T
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var r4 = _.all([<any>true], _.identity);
|
2015-04-16 01:44:20 +02:00
|
|
|
>r4 : any
|
2014-08-15 23:33:16 +02:00
|
|
|
>_.all([<any>true], _.identity) : any
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
|
2014-08-15 23:33:16 +02:00
|
|
|
>[<any>true] : any[]
|
|
|
|
><any>true : any
|
2015-04-13 21:36:11 +02:00
|
|
|
>true : boolean
|
2015-04-16 01:44:20 +02:00
|
|
|
>_.identity : <T>(value: T) => T
|
|
|
|
>_ : Underscore.Static
|
|
|
|
>identity : <T>(value: T) => T
|
2014-08-15 23:33:16 +02:00
|
|
|
|