-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Compile enum declarations into variant constructors and support qualified access (e.g. Color.Red).
Checklist
Compiler
- Compile
enum_declarationstatement: for each variant, emit a struct_constructor callable with the qualified name (EnumName.VariantName) - Track
known_enum_namesso zero-field variants referencing an existing enum get nested coercion (single-field wrapper) - Compile qualified variant access (
Color.Red) viafield_accesson a variable — resolve to the constructor in the environment
VM
- Ensure variant instances are regular
StructInstancevalues withkind = .case - Variant construction with fields reuses the struct construction path
Tests
- Simple enum declaration + variant construction (zero fields)
- Enum variant with fields (e.g.
Shape.Circle(radius)) - Qualified access
Enum.Variantresolves correctly - Nested enum coercion (variant name matches an existing enum type)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request