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
spreading generic type disables excess property checking #30129
I believe this one must not typecheck, but it is.
That way we can not only add excess properties, but also get invalid object as a result. For example:
assignRandomStuff({foo: 'string value'});
This one returns { foo: number, bar: boolean } but typescript believes it is { foo: string }
Activity
akozhemiakin commentedon Mar 31, 2020
The problem is actually more generic, not only about excess properties.
I believe this one must not typecheck, but it is.
That way we can not only add excess properties, but also get invalid object as a result. For example:
This one returns
{ foo: number, bar: boolean }but typescript believes it is{ foo: string }