-
Notifications
You must be signed in to change notification settings - Fork 7
Fix optional and undefined properties for custom types
#94
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
Fix optional and undefined properties for custom types
#94
Conversation
# Conflicts: # CHANGELOG.md # packages/typir/src/kinds/custom/custom-type.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for these fixes @JohannesMeierSE. I am going to approve but I'd like to understand the topic in my detail remark.
| ### Fixed bugs | ||
|
|
||
| - Initializing optional properties of custom types with `undefined` failed, as reported in [#77](https://github.com/TypeFox/typir/discussions/77#discussioncomment-14149139). | ||
| - When checking the equality of custom types, the values for the same property might have different TypeScript types, since optional propeties might be set to `undefined`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - When checking the equality of custom types, the values for the same property might have different TypeScript types, since optional propeties might be set to `undefined`. | |
| - When checking the equality of custom types, the values for the same property might have different TypeScript types, since optional properties might be set to `undefined`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the addition to the message. I think it is ready to go now.
| firstValue: typeof value1, | ||
| secondValue: typeof value2, | ||
| firstValue: `'${String(value1)}' has the TypeScript type ${typeof value1}`, | ||
| secondValue: `'${String(value2)}' has the TypeScript type ${typeof value2}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this addition. Thanks!
This PR improves the handling of optional properties for custom types:
undefinedin explicit way to optional properties.undefinedin explicit way.