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
Actual behavior:
Error TS2322: Type '{}' is not assignable to type 'T' / 'Partial'
Forgive me if this is simply a limitation of the Typescript engine and the implementation of Partial, but I don't know enough about the internals to make a judgement there.
The text was updated successfully, but these errors were encountered:
The first example is not a bug. Being constrained by a partial type does not mean that you don't have additional required properties. Remember that a constraint is an upper bound on a type, not a lower bound - the concrete type of T at any call site may have additional properties and those properties may be required; the Partial<I> constraint only means that any properties in T which match those of I must have types which are assignable to the corresponding types in I
TypeScript Version: 2.1.4
Code
Expected behavior:
No errors
Actual behavior:
Error TS2322: Type '{}' is not assignable to type 'T' / 'Partial'
Forgive me if this is simply a limitation of the Typescript engine and the implementation of Partial, but I don't know enough about the internals to make a judgement there.
The text was updated successfully, but these errors were encountered: