63 lines
3.8 KiB
Text
63 lines
3.8 KiB
Text
=== tests/cases/compiler/genericArgumentCallSigAssignmentCompat.ts ===
|
|
module Underscore {
|
|
>Underscore : Symbol(Underscore, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 0))
|
|
|
|
export interface Iterator<T, U> {
|
|
>Iterator : Symbol(Iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 19))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 30))
|
|
>U : Symbol(U, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 32))
|
|
|
|
(value: T, index: any, list: any): U;
|
|
>value : Symbol(value, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 9))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 30))
|
|
>index : Symbol(index, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 18))
|
|
>list : Symbol(list, Decl(genericArgumentCallSigAssignmentCompat.ts, 2, 30))
|
|
>U : Symbol(U, Decl(genericArgumentCallSigAssignmentCompat.ts, 1, 32))
|
|
}
|
|
|
|
export interface Static {
|
|
>Static : Symbol(Static, Decl(genericArgumentCallSigAssignmentCompat.ts, 3, 5))
|
|
|
|
all<T>(list: T[], iterator?: Iterator<T, boolean>, context?: any): boolean;
|
|
>all : Symbol(all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12))
|
|
>list : Symbol(list, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 15))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12))
|
|
>iterator : Symbol(iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 25))
|
|
>Iterator : Symbol(Iterator, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 19))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 12))
|
|
>context : Symbol(context, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 58))
|
|
|
|
identity<T>(value: T): T;
|
|
>identity : Symbol(identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17))
|
|
>value : Symbol(value, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 20))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17))
|
|
>T : Symbol(T, Decl(genericArgumentCallSigAssignmentCompat.ts, 7, 17))
|
|
}
|
|
}
|
|
|
|
declare var _: Underscore.Static;
|
|
>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11))
|
|
>Underscore : Symbol(Underscore, Decl(genericArgumentCallSigAssignmentCompat.ts, 0, 0))
|
|
>Static : Symbol(Underscore.Static, Decl(genericArgumentCallSigAssignmentCompat.ts, 3, 5))
|
|
|
|
// No error, Call signatures of types '<T>(value: T) => T' and 'Underscore.Iterator<{}, boolean>' are compatible when instantiated with any.
|
|
// Ideally, we would not have a generic signature here, because it should be instantiated with {} during inferential typing
|
|
_.all([true, 1, null, 'yes'], _.identity);
|
|
>_.all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29))
|
|
>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11))
|
|
>all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29))
|
|
>_.identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83))
|
|
>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11))
|
|
>identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83))
|
|
|
|
// Ok, because fixing makes us infer boolean for T
|
|
_.all([true], _.identity);
|
|
>_.all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29))
|
|
>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11))
|
|
>all : Symbol(Underscore.Static.all, Decl(genericArgumentCallSigAssignmentCompat.ts, 5, 29))
|
|
>_.identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83))
|
|
>_ : Symbol(_, Decl(genericArgumentCallSigAssignmentCompat.ts, 11, 11))
|
|
>identity : Symbol(Underscore.Static.identity, Decl(genericArgumentCallSigAssignmentCompat.ts, 6, 83))
|
|
|