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

@name not applied with single-field group choices #153

Closed
rooooooooob opened this issue Mar 14, 2023 · 1 comment · Fixed by #213
Closed

@name not applied with single-field group choices #153

rooooooooob opened this issue Mar 14, 2023 · 1 comment · Fixed by #213
Labels
bug Something isn't working

Comments

@rooooooooob
Copy link
Collaborator

Works (first variant named These, 4th Nameable):

group_choice = [
  ; @name these
  2, foo //
  ; @name nameable
  3, basic
]

First variant does not get named These, 4th not Nameable:

group_choice = [
  ; @name these
  foo //
  ; @name nameable
  basic
]

foo is an array group and basic a basic group so that shouldn't be relevant.

@rooooooooob rooooooooob added the bug Something isn't working label Mar 14, 2023
@rooooooooob
Copy link
Collaborator Author

Extra context:

fields with fixed values have it properly applied even if there's only 1 non-fixed variant e.g.:

group_choice = [
  ; @name these
  foo //
  ; if there is only one non-constant field in the inlined group then that will be inlined in the enum
  ; @name are
  0, x: uint //
  ; but if there are multiple then a new struct will be generated from this variant
  ; @name also
  1, x: uint, y: text //
  ; basic groups can be embedded into group choices, taking on the format of the outer group
  ; @name nameable
  basic
]

has the Are variant properly have its named applied despite it inlining the uint field.

rooooooooob added a commit that referenced this issue Nov 15, 2023
rooooooooob added a commit that referenced this issue Nov 21, 2023
* Fix @name not working on single elem group choices

Fixes #211
Fixes #153

* Add use of @name into test cases (tests compiling)
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 a pull request may close this issue.

1 participant