Skip to content
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 error in internally tagged enums with flattened fields #344

Merged
merged 2 commits into from
Jul 27, 2024

Conversation

gustavo-shigueo
Copy link
Collaborator

Goal

Fix internally tagged enum with struct variant containing inlined field
Closes #343

Changes

Instead of attempting to format the variant in the format_variant function, allow type_def to generate a fully formatted variant by giving it the variant's name and tag

Checklist

  • I have followed the steps listed in the Contributing guide.
  • If necessary, I have added documentation related to the changes made.
  • I have added or updated the tests related to the changes made.

@gustavo-shigueo
Copy link
Collaborator Author

This also fixes an oversight in #244 by wrapping the name of struct tag fields in quotes, like already happened in enums. This allows a tag to be any string, rather than only valid JS identifiers, e.g.: kebab-case string

@gustavo-shigueo gustavo-shigueo merged commit 5c3b8c9 into main Jul 27, 2024
16 checks passed
@gustavo-shigueo gustavo-shigueo deleted the complex_flattened_type_error branch July 27, 2024 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: complex nested (and flattened) enum type produces invalid syntax
1 participant