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

tagged unions should permit tag-only interpretations #20

Closed
pabigot opened this issue Mar 12, 2018 · 0 comments
Closed

tagged unions should permit tag-only interpretations #20

pabigot opened this issue Mar 12, 2018 · 0 comments
Assignees
Milestone

Comments

@pabigot
Copy link
Owner

pabigot commented Mar 12, 2018

The following should be permitted:

  const un = lo.union(lo.u8('mode'), lo.blob(4));
  un.addVariant(0, 'off');

so that off provides only the mode property with value zero.

@pabigot pabigot self-assigned this Mar 12, 2018
@pabigot pabigot added this to the v1.2.0 milestone Mar 12, 2018
pabigot added a commit that referenced this issue Mar 13, 2018
Allow a union variant that provides no layout, i.e. all information
required is conveyed by the identity of the variant, which is exposed as
the union discriminator.

Closes #20.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant