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
Since Partial makes every property optional, we should expect {} to be assignable to every Partial<O>, regardless of what the generic type O is.
Random speculation: Is this intended behavior because O could include required properties on its prototype that aren't on {}, even if all of the properties on O itself are optional? If that's the case, is there a way to specify that we don't care about the prototype's properties?
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.1.4
Expected behavior:
No errors.
Actual behavior:
Type '{}' is not assignable to type 'Partial<O>'.
Since
Partial
makes every property optional, we should expect{}
to be assignable to everyPartial<O>
, regardless of what the generic typeO
is.Random speculation: Is this intended behavior because
O
could include required properties on its prototype that aren't on{}
, even if all of the properties onO
itself are optional? If that's the case, is there a way to specify that we don't care about the prototype's properties?The text was updated successfully, but these errors were encountered: