green(reify): implement reify(.enum) — mint a flat enum from TypeInfo

REIFY Phase 0.2 (Phase 0 complete). Lowering.reifyType (lower/nominal.zig)
reads the flat-enum TypeInfo literal off the AST, synthesizes an
ast.EnumDecl, and feeds it through the SAME type_bridge.buildEnumInfo
path source enums use — so the minted type is byte-identical to a
hand-written `enum { value: i64; closed; }` and flows through enum
codegen (layout / construct / match) UNMODIFIED (Contract 2).

Wired at the `E :: reify(...)` const-decl hook in lower/decl.zig
(replacing the Phase-0.0 loud bail). Unsupported argument shapes bail
loudly via reifyBail — never a silent default. The generic.zig inline
reify path now reports it's only supported in a `::` binding (Phase 0).

examples/0614 green: reify a {value: i64, closed} enum, construct
.value(3) and .closed, match both -> "value 3" / "closed". Full suite
green (670 examples, 447 unit).
This commit is contained in:
agra
2026-06-16 18:32:05 +03:00
parent b25a2f60d6
commit 353109206b
10 changed files with 155 additions and 30 deletions

View File

@@ -106,7 +106,8 @@ Examples: `06xx` (comptime, deterministic), `11xx` (diagnostics for loud failure
## Status
- [ ] Phase 0 — `reify` flat enum
- [x] Phase 0 — `reify` flat enum (`reify(.enum(...))` mints a flat enum via the
shared `buildEnumInfo` path; `examples/0614` green; Contract 2 confirmed)
- [ ] Phase 1 — type-fn identity
- [ ] Phase 2 — `type_info` + `field_type`
- [ ] Phase 3 — `make_enum` + `RecvResult`/`TryResult`