You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
no error when using spread operator with object of incorrect type #41698
typeFoo={bar: number}letfoo: Foo={bar: 1}foo.baz=1//Property 'baz' does not exist on type 'Foo'.foo={...foo,baz: 1}//Type '{ baz: number; bar: number; }' is not assignable to type 'Foo'. Object literal may only specify known properties, and 'baz' does not exist in type 'Foo'.foo={...foo, ...{baz: 1}}// no error
Activity
MartinJohns commentedon Nov 26, 2020
Duplicate of #39998.
On a side-note: This is still type-safe. Extra-properties on objects are allowed. Excess property checks are more of a linter feature.
typescript-bot commentedon Dec 5, 2020
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.