1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
=== tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts ===
var f : {
>f : <T>(x: T) => T
<T>(x:T): T;
>x : T
}
var g : {
>g : <S>() => S[]
<S>() : S[];
} = () => [];
>() => [] : () => any[]
>[] : undefined[]
f = g;
>f = g : <S>() => S[]
>f : <T>(x: T) => T
>g : <S>() => S[]
var s = f("str").toUpperCase();
>s : string
>f("str").toUpperCase() : string
>f("str").toUpperCase : () => string
>f("str") : "str"
>f : <T>(x: T) => T
>"str" : "str"
>toUpperCase : () => string
console.log(s);
>console.log(s) : void
>console.log : (message?: any, ...optionalParams: any[]) => void
>console : Console
>log : (message?: any, ...optionalParams: any[]) => void
>s : string
|