2014-07-13 01:04:16 +02:00
|
|
|
//// [inferTypeArgumentsInSignatureWithRestParameters.ts]
|
|
|
|
function f<T>(array: T[], ...args) { }
|
|
|
|
function g(array: number[], ...args) { }
|
|
|
|
function h<T>(nonarray: T, ...args) { }
|
|
|
|
function i<T>(array: T[], opt?: any[]) { }
|
|
|
|
var a = [1, 2, 3, 4, 5];
|
|
|
|
|
|
|
|
f(a); // OK
|
|
|
|
g(a); // OK
|
|
|
|
h(a); // OK
|
|
|
|
i(a); // OK
|
|
|
|
|
|
|
|
|
|
|
|
//// [inferTypeArgumentsInSignatureWithRestParameters.js]
|
2015-02-07 03:45:09 +01:00
|
|
|
function f(array) { }
|
|
|
|
function g(array) { }
|
|
|
|
function h(nonarray) { }
|
|
|
|
function i(array, opt) { }
|
2014-07-13 01:04:16 +02:00
|
|
|
var a = [1, 2, 3, 4, 5];
|
2014-08-16 00:49:09 +02:00
|
|
|
f(a); // OK
|
|
|
|
g(a); // OK
|
|
|
|
h(a); // OK
|
|
|
|
i(a); // OK
|