15 lines
No EOL
557 B
Text
15 lines
No EOL
557 B
Text
==== 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 'concat' is missing in type 'Number'.
|
|
n([4], 'foo');
|
|
|