-
-
Notifications
You must be signed in to change notification settings - Fork 503
fix(core): generate correct enum types when combining enums #2057
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
base: master
Are you sure you want to change the base?
fix(core): generate correct enum types when combining enums #2057
Conversation
soartec-lab
left a comment
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.
@AllieJonsson
Thank you in advance. I added several comments.
packages/core/src/getters/combine.ts
Outdated
| if (isRef[0]) { | ||
| return values[0]; | ||
| } | ||
| const getEnumImplementation = ( |
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.
Since we want to consolidate enum definitions into one file, getEnumImplementation, getEnumImplementation, and getCombineEnumValue should be moved to enum.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.
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.
@AllieJonsson
Can we move getCombineEnumValue as well?
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.
Sorry, I forgot it
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.
It's Okey!
|
Well crap, this build error is probably difficult to fix, Im not sure we have the data we need at the point we need it... Ill look into it later today |
|
|
||
| let enumValue = `[${joindEnumValues}]`; | ||
| if (context.output.override.enumGenerationType === EnumGeneration.ENUM) { | ||
| if (item.isRef || existingReferencedProperties.length === 0) { |
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.
so type annotations are no longer possible.
Is this a temporary fix? Or will it become permanent?
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.
It is temporary, I will mark this as a draft as there are more issues that needs to be fixed in #2065
Status
READY
Description
Fixes #2010