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
AFAICT, there is no broadly-functional implementation of Exclude/Omit that works when there's a union in the remaining difference. I'd suggest that perhaps Exclude might be enhanced to handle this case.
The Omit implementations I'm aware of rely on keyof, which doesn't include any members of one union member that aren't present in all. This is by design; see #12948.
2.8's Exclude won't work on such a type at all, complaining that it's not an interface.
This blocked one route in my particular production (one of many!) of "The Failed Quest for a Typescript React HOC Declaration With Generic Inferencing That Works". See mui/material-ui#11003 (likely to be rolled back soon).
The text was updated successfully, but these errors were encountered:
estaub
changed the title
Allow Exclude when the remainder contains a union.
Allow Exclude when the difference contains a union.
May 3, 2018
Sorry, this is why one should never write an issue without the code in front of you. I got Exclude and 'extends?' (conditional typing) befuddled. Closing.
AFAICT, there is no broadly-functional implementation of Exclude/Omit that works when there's a union in the remaining difference. I'd suggest that perhaps Exclude might be enhanced to handle this case.
The
Omit
implementations I'm aware of rely onkeyof
, which doesn't include any members of one union member that aren't present in all. This is by design; see #12948.2.8's
Exclude
won't work on such a type at all, complaining that it'snot an interface
.This blocked one route in my particular production (one of many!) of "The Failed Quest for a Typescript React HOC Declaration With Generic Inferencing That Works". See mui/material-ui#11003 (likely to be rolled back soon).
The text was updated successfully, but these errors were encountered: