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
temp.ts(8,22): error TS2345: Argument of type '{ body: string; }' is not assignable to parameter of type 'Partial<O>'.
This doesn't make much sense because { body: obj['body'] } is correctly determined as { body: string } which is same as Obj<string>, and so compatible with Partial<Obj<string>> and any Partial<O> in this context.
Moreover, calling acceptPartial<Obj<string>> instead of O works which seems to mean that Partial doesn't currently "understand" that Partial<O> is just a superset of Partial<Obj<string>> when O extends Obj<string>.
The text was updated successfully, but these errors were encountered:
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.2
Code
(Note this is a simplified example and easy to workaround, but it gets dirtier in a real-world code)
Expected behavior:
No type errors.
Actual behavior:
This doesn't make much sense because
{ body: obj['body'] }
is correctly determined as{ body: string }
which is same asObj<string>
, and so compatible withPartial<Obj<string>>
and anyPartial<O>
in this context.Moreover, calling
acceptPartial<Obj<string>>
instead ofO
works which seems to mean thatPartial
doesn't currently "understand" thatPartial<O>
is just a superset ofPartial<Obj<string>>
whenO extends Obj<string>
.The text was updated successfully, but these errors were encountered: