-
Notifications
You must be signed in to change notification settings - Fork 74
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
Dynamic: support open enums #1244
Conversation
@@ -256,9 +256,33 @@ private[dynamic] object Compiler { | |||
) | |||
} | |||
|
|||
val theEnum = stringEnumeration(values, values) | |||
if (shape.traits.contains(IdRef("alloy#openEnum"))) { | |||
// the runtime representation of normal enums is Int, but for open enums it's String to support arbitrary unknown values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: should we go for a String
representation for all the cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that'd make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although, int is fine for the closed-enum case
Closes #1243