TypeScript/tests/baselines/reference/restArgAssignmentCompat.errors.txt

15 lines
557 B
Plaintext

==== tests/cases/compiler/restArgAssignmentCompat.ts (1 errors) ====
function f(...x: number[]) {
x.forEach((n, i) => void ('item ' + i + ' = ' + n));
}
function g(x: number[], y: string) { }
var n = g;
n = f;
~
!!! Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void':
!!! Types of parameters 'x' and 'x' are incompatible:
!!! Type 'number' is not assignable to type 'number[]':
!!! Property 'length' is missing in type 'Number'.
n([4], 'foo');