56 lines
1.1 KiB
Text
56 lines
1.1 KiB
Text
=== 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[]
|
|
>1 : number
|
|
>2 : number
|
|
>3 : number
|
|
>4 : number
|
|
>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[]
|
|
|