-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Omit not working properly #54904
Comments
This is working as intended. See #54451 and the linked issues. |
Thanks for the hyperlink. Still feels like a bug to me though. When omitting something we expect the rest to stay the same and only the ones mentioned affected. The behaviour doesn’t match up with the meaning of the word at all. Hope they revamp it officially. |
If you look up the definition of
As per the issue and it's linked issues: they will not. Now changing the definition of |
I looked up the definition of omit as you suggested: Sounds like it’s not working as per definition. It’s erroring out as per my playground. Please enlighten me (with details if possible) if I am missing something here. |
|
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Bug Report
After using Omit<>, my undefined key errored out.
Example of working (before Omit) and notworking (after Omit) inside:
https://www.typescriptlang.org/play?#code/FASwdgLgpgTgZgQwMZQAQEFUG9ir65JAewFdIAuVAZwhnAHMBuXfBCaAWwAcIrKa6YJsAC+oSLEQpUAIWws8AIxAAbFZRz4tqMAg5R+tBsy0jUAH1RkAJlDjgo1xqgD0L1AHkeIIrpUA6UXFoeGQ0AGF5LWIJCijtPGgADwhDQWFTIIgATy40ABFUAF4MVAAyVEiKmWYcvNQAUWLSivDmKCSuIhgIVDq0ADFmwssG5mAYmmoifQA1BBgAOSIIDw4QdkdKIZLNVk3uXkoAImOAGgVUZTVKGzsHazPXd3Q1VHoiImtUAHcAC1UaDAKysVAYnnWEAAPAA+S4xaBxPYJZKpVCnS4iC5aQikOIYsTAfqoAASzTWGyhAyex1xZAgxxhzEmvSoMyg8xgFM21koZN2lzYnB4fHR50u13UVjAtnsYEcTzcVxgRAA1lAwKg-rA0GQVFAqFRUMQOPoJN9SBB4b5EWjkdpUSdjpjsawkMR6U6WCJxkrifyIZTqei6ZBGYwgA
🔎 Search Terms
Omit
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
// playground.
🙁 Actual behavior
Error!
🙂 Expected behavior
Working without error by TypeScript when 'bill' key is defined to be
undefined
.The text was updated successfully, but these errors were encountered: