-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Omit
on an Object Union applies on the merged type instead of the union members
#57085
Comments
This is working as intended. See also #54451, and many many many other issues (search for |
Ah, my bad. Guess I should've been more diligent with my issue searching :/ Still not too keen on the push into userland, but #53169 was mentioned in #54451 and the points outlined make the MappedOmit userland definition an easier pill to swallow. Would it be possible to either add to the JSDoc of |
Yeah, I don't think the TS team really wanted to push it into userland either, but it was kind of a catch-22: |
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@fatcerberus Is this not what Semver Major versions are for? At the very least, it'd be great to get some sort of an official commitment to fix |
TypeScript does not follow SemVer (for good reasons). And |
🔎 Search Terms
"omit", "omit union"
#54371 is related to this issue, but is specific to tuples. This issue applies to objects in general
🕗 Version & Regression Information
⏯ Playground Link
https://www.typescriptlang.org/play?#code/C4TwDgpgBAMhBmwoF4oG8BQUqkgLigCIAbBYQgbiygGNiB7AZwgIAoBKFAPigDd6AlgBMq2RgFcARgFsBwNmACGIBoqEFGwAE4CAdgHNOyHgAUt9WcwA8-YVyoBfDBlzQASgP0ALJKkzZXAkIdb3JRWgZmNiMeWxFqCRk5BWVVdShdcWlJCC0YqDMLAWs4+2p6EL1FYg1tPX1HZ1coAFVdAXpdFFgyKAAfKA9QqgwaTs0oeHp6AjaOrr9qQKIQn0IAGnLK3WqgqfpJRS0N6jomFigObnQHTbEpWXkoJRV6NWvCywgAOi0IRnoxF4EA41AA9GCAHoAfgwDhGzQA8o9gBAhN1kXIrHNOusiGdmIQyqNxkhDloCJjgKj0YsAuALsFPGs7lAKp4qjUiPtySd7kkni80h9zF9fv9AcDQdgITC4c4IVAfMAwIw8BD9HIvFJvmNpGDZDRzADEGCACoMgDKRoEYGAYOKEn+YIArAAWADMAHYAIwAYkd4ggeukEF0wAAtD6XQA2AAcca9AAY4x6Yy4GVAABIWXNaMBeAQ0KlWM14gDSPD8UAA2iYoHooABrCAgejwKBmqCKRgFKAQAAeqN0Ql75ag0IyEGBWigBBMAF0CGa6wuoPCmpmAHIQADuVJp3Rz0jzBaLJZxujxhAJECJIzGugmhwAXgQd-uUWjuv4cAygqs5Csuymo7FyhA8kcfJQIkjwEEKby0qYorFD8fwAkCILsOCUKwvKQA
💻 Code
🙁 Actual behavior
Omit
consolidates the union into a single type🙂 Expected behavior
I expected
Omit
to operate on all members of a unionAdditional information about the issue
In #54371 (comment) Ryan mentions a modified version of
Omit
, that I've verified in my Playground link works for object unions.The text was updated successfully, but these errors were encountered: