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
The use of intersection in Object.assign is an approximation. the correct behavior is that of spread, i.e. the type for the property in the last argument overrides those of the previous argument. that is tracked by #11100.
We first need higher-order spread operator to be added to the language, which is tracked by #10727
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Code
Expected behavior:
Variable type should be
number | string
.Actual behavior:
It is
number & string
.In general we cannot presume that every function that produces intersections will also intersect any properties.
The text was updated successfully, but these errors were encountered: