52 lines
1 KiB
Plaintext
52 lines
1 KiB
Plaintext
|
=== tests/cases/compiler/inferTypeArgumentsInSignatureWithRestParameters.ts ===
|
||
|
function f<T>(array: T[], ...args) { }
|
||
|
>f : <T>(array: T[], ...args: any[]) => void
|
||
|
>T : T
|
||
|
>array : T[]
|
||
|
>T : T
|
||
|
>args : any[]
|
||
|
|
||
|
function g(array: number[], ...args) { }
|
||
|
>g : (array: number[], ...args: any[]) => void
|
||
|
>array : number[]
|
||
|
>args : any[]
|
||
|
|
||
|
function h<T>(nonarray: T, ...args) { }
|
||
|
>h : <T>(nonarray: T, ...args: any[]) => void
|
||
|
>T : T
|
||
|
>nonarray : T
|
||
|
>T : T
|
||
|
>args : any[]
|
||
|
|
||
|
function i<T>(array: T[], opt?: any[]) { }
|
||
|
>i : <T>(array: T[], opt?: any[]) => void
|
||
|
>T : T
|
||
|
>array : T[]
|
||
|
>T : T
|
||
|
>opt : any[]
|
||
|
|
||
|
var a = [1, 2, 3, 4, 5];
|
||
|
>a : number[]
|
||
|
>[1, 2, 3, 4, 5] : number[]
|
||
|
|
||
|
f(a); // OK
|
||
|
>f(a) : void
|
||
|
>f : <T>(array: T[], ...args: any[]) => void
|
||
|
>a : number[]
|
||
|
|
||
|
g(a); // OK
|
||
|
>g(a) : void
|
||
|
>g : (array: number[], ...args: any[]) => void
|
||
|
>a : number[]
|
||
|
|
||
|
h(a); // OK
|
||
|
>h(a) : void
|
||
|
>h : <T>(nonarray: T, ...args: any[]) => void
|
||
|
>a : number[]
|
||
|
|
||
|
i(a); // OK
|
||
|
>i(a) : void
|
||
|
>i : <T>(array: T[], opt?: any[]) => void
|
||
|
>a : number[]
|
||
|
|