-
Notifications
You must be signed in to change notification settings - Fork 23
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
allow when
in enum types
#190
Comments
I like this, the only possible issue is that this can affect the ordinal value of an enum |
but hopefully ordinal value wouldn't be part of public interface |
It's a "natural" feature, yet, I prefer to handle this via a macro. The syntactic and implementation effort would be quite severe. |
in my use case it was for NimNodeKind which can't be handled with a macro; although this is an edge case though and wouldn't justify a language feature just because of that... still not sure to do in that case... but generally ya a macro would give maximum flexibility and no language change; feel free to close |
Such a rare offering that I can't resist. |
when is allowed inside
type Foo = object
but not insidetype Foo = enum
; this proposal is to allow:byaddr x = expr
Nim#13342) I had to addnnkCustomDefSection
at the end to avoid breaking bootstrap (which isn't still super satisfactory because we're out of sync with an extra element), whereas I could've instead done, with this feature:The text was updated successfully, but these errors were encountered: