94 lines
2.6 KiB
Text
94 lines
2.6 KiB
Text
=== tests/cases/compiler/genericTypeArgumentInference1.ts ===
|
|
module Underscore {
|
|
>Underscore : any
|
|
|
|
export interface Iterator<T, U> {
|
|
>Iterator : Iterator<T, U>
|
|
>T : T
|
|
>U : U
|
|
|
|
(value: T, index: any, list: any): U;
|
|
>value : T
|
|
>T : T
|
|
>index : any
|
|
>list : any
|
|
>U : U
|
|
}
|
|
export interface Static {
|
|
>Static : Static
|
|
|
|
all<T>(list: T[], iterator?: Iterator<T, boolean>, context?: any): T;
|
|
>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
|
|
|
|
identity<T>(value: T): T;
|
|
>identity : <T>(value: T) => T
|
|
>T : T
|
|
>value : T
|
|
>T : T
|
|
>T : T
|
|
}
|
|
}
|
|
declare var _: Underscore.Static;
|
|
>_ : Underscore.Static
|
|
>Underscore : any
|
|
>Static : Underscore.Static
|
|
|
|
var r = _.all([true, 1, null, 'yes'], _.identity);
|
|
>r : string | number | boolean
|
|
>_.all([true, 1, null, 'yes'], _.identity) : string | number | boolean
|
|
>_.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
|
|
>[true, 1, null, 'yes'] : (string | number | boolean)[]
|
|
>true : boolean
|
|
>1 : number
|
|
>null : null
|
|
>'yes' : string
|
|
>_.identity : <T>(value: T) => T
|
|
>_ : Underscore.Static
|
|
>identity : <T>(value: T) => T
|
|
|
|
var r2 = _.all([true], _.identity);
|
|
>r2 : boolean
|
|
>_.all([true], _.identity) : boolean
|
|
>_.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
|
|
>[true] : boolean[]
|
|
>true : boolean
|
|
>_.identity : <T>(value: T) => T
|
|
>_ : Underscore.Static
|
|
>identity : <T>(value: T) => T
|
|
|
|
var r3 = _.all([], _.identity);
|
|
>r3 : any
|
|
>_.all([], _.identity) : any
|
|
>_.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
|
|
>[] : undefined[]
|
|
>_.identity : <T>(value: T) => T
|
|
>_ : Underscore.Static
|
|
>identity : <T>(value: T) => T
|
|
|
|
var r4 = _.all([<any>true], _.identity);
|
|
>r4 : any
|
|
>_.all([<any>true], _.identity) : any
|
|
>_.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
|
|
>[<any>true] : any[]
|
|
><any>true : any
|
|
>true : boolean
|
|
>_.identity : <T>(value: T) => T
|
|
>_ : Underscore.Static
|
|
>identity : <T>(value: T) => T
|
|
|