Closed
Description
TypeScript Version: 2.2.1 / 2.1.4
Code
let foo: Array<number> = [1, 2, 3, 4];
let bar: Array<number> = { ...foo };
When I try to compile with [email protected]
, I get the following error:
error TS2322: Type '{ [n: number]: number; length: number; }' is not assignable to type 'number[]'.
Property 'push' is missing in type '{ [n: number]: number; length: number; }'.
With [email protected]
I no longer get an error. This should not compile as bar
is not of type Array<number>
.