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
Argument of type '{ body: string; message: object; } | { message: object; }' is not assignable to parameter of type '{ body: string; message: object; }'.
Property 'body' is missing in type '{ message: object; }' but required in type '{ body: string; message: object; }'.
🙂 Expected behavior
TypeScript compiler should have been able to infer that action.type and action.payload are connected. It looks like it is treating them as independent variables.
The text was updated successfully, but these errors were encountered:
Bug Report
🔎 Search Terms
Issue in inferring types in Switch Case for object methods having union mapped types.
🕗 Version & Regression Information
Version - All versions upto v5.0.0-dev.20221116
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Getting this error -
🙂 Expected behavior
TypeScript compiler should have been able to infer that
action.type
andaction.payload
are connected. It looks like it is treating them as independent variables.The text was updated successfully, but these errors were encountered: