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

avoid @Type(.EnumLiteral) when possible #32

Open
nektro opened this issue Apr 2, 2024 · 0 comments
Open

avoid @Type(.EnumLiteral) when possible #32

nektro opened this issue Apr 2, 2024 · 0 comments

Comments

@nektro
Copy link
Owner

nektro commented Apr 2, 2024

its not something that should never be used, but using a discrete enum almost always makes code more readable and produces better error messages. FieldEnum and DeclEnum from std.meta go a long way in this regard. tactful in-line parameter enums can also be useful (eg foo: enum { fast, slow })

this also goes hand-in-hand with the general advice of preferring enum arguments over booleans

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