feat(metatype): make_enum — general enum constructor over a []EnumVariant value
make_enum(name, variants: []EnumVariant) -> Type mints a nominal enum from a variant list passed as a VALUE, not a hardcoded literal — the open-ended form the channel-result constructors are special cases of. Pure sx over declare/define; no compiler machinery. Because variants is an ordinary comptime value, a non-generic builder can ASSEMBLE it in a local before minting. examples/0620: build_level fills a local array, then make_enum mints Level from it — exercising define decoding a value-arg SLICE (decodeVariantElements' slice branch), vs. the inline .[ … ] array the 0614-0618 examples pass directly. No compiler change (locks existing capability). Suite green (678).
This commit is contained in:
1
examples/expected/0620-comptime-metatype-make-enum.exit
Normal file
1
examples/expected/0620-comptime-metatype-make-enum.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
info
|
||||
warn
|
||||
fatal code=70
|
||||
Reference in New Issue
Block a user