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
TypeScript Version: Since at least 2.5.3 (repros in 2.7.0)
Code
constv: Partial<Window>=5;
Expected behavior: Compilation fails saying 5 is not assignable to Partial. Actual behavior: Compiles.
More thoughts:
While {} is assignable to Partial types, types which have no overlap in properties are not. This is helpful in catching many errors. As an extension of that, I think primitives such as number and string should not be assignable to Partials.
The text was updated successfully, but these errors were encountered:
TypeScript Version: Since at least 2.5.3 (repros in 2.7.0)
Code
Expected behavior: Compilation fails saying 5 is not assignable to Partial.
Actual behavior: Compiles.
More thoughts:
While
{}
is assignable toPartial
types, types which have no overlap in properties are not. This is helpful in catching many errors. As an extension of that, I think primitives such asnumber
andstring
should not be assignable to Partials.The text was updated successfully, but these errors were encountered: