Files

7 lines
433 B
Plaintext

contextualTyping4.ts(1,46): error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'.
==== contextualTyping4.ts (1 errors) ====
class foo { public bar:{id:number;} = {id:5, name:"foo"}; }
~~~~
!!! error TS2353: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'.