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

Generate a OneOf type based on an existing Enum #166

Open
wtaisto opened this issue Oct 8, 2023 · 0 comments
Open

Generate a OneOf type based on an existing Enum #166

wtaisto opened this issue Oct 8, 2023 · 0 comments

Comments

@wtaisto
Copy link

wtaisto commented Oct 8, 2023

To promote interacting with existing Enum's using the OneOf paradigm, it might be nice to be able to apply a generic GenerateOneOf attribute to a class, which would wrap each of the Enum type's values in it's own struct, and then compose a OneOf implementation which will select / match against those wrapped struct types. This OneOf type could have a helper to instantiate it from a value from the underlying Enum.

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

No branches or pull requests

1 participant