Files

7 lines
343 B
Plaintext

contextualTyping21.ts(1,51): error TS2322: Type 'number' is not assignable to type '{ id: number; }'.
==== contextualTyping21.ts (1 errors) ====
var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1];
~
!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'.