green(reify): type-fn bodies comptime-evaluated; reify fully removed from the compiler

Second slice of the re-architecture — the compiler now has ZERO type-
construction code beyond declare/define.

- instantiateTypeFunction: a type-fn body returning a computed Type (a call
  to a non-generic, bodied, Type-returning fn) is comptime-evaluated with the
  type bindings active, then renamed to the mangled instantiation name for
  identity (renameNominalType). Replaces the old reify-call pattern-matching.
- DELETED: reifyType (lower/nominal.zig), findReturnReifyCall (lower/generic.zig),
  and the stale inline-position reify gate in resolveTypeCallWithBindings.
- evalComptimeType (was evalComptimeTypeNamed): pure eval, no rename; the
  type-fn caller renames explicitly. renameReifiedType → renameNominalType.
- The TYPE NAME now travels in the data: EnumInfo gains `name`, and define()
  names the slot from it (the compiler derives no name from a binding LHS).
  examples/0614/0615 carry `name = "..."`; RecvResult/TryResult set it too.
- field_type stays a reflection #builtin (reads a type); only construction
  moved out. All reify mentions stripped from compiler source.

examples 0614/0615/0617 run on the floor. Full suite green (673).
This commit is contained in:
agra
2026-06-16 21:03:16 +03:00
parent 442a70b8c9
commit 8ae655687a
11 changed files with 112 additions and 194 deletions

View File

@@ -1566,8 +1566,8 @@ pub const Lowering = struct {
pub const evalComptimeMatch = lower_comptime.evalComptimeMatch;
pub const evalComptimeInt = lower_comptime.evalComptimeInt;
pub const evalComptimeString = lower_comptime.evalComptimeString;
pub const evalComptimeTypeNamed = lower_comptime.evalComptimeTypeNamed;
pub const renameReifiedType = lower_comptime.renameReifiedType;
pub const evalComptimeType = lower_comptime.evalComptimeType;
pub const renameNominalType = lower_comptime.renameNominalType;
pub const lowerComptimeGlobal = lower_comptime.lowerComptimeGlobal;
pub const lowerComptimeSideEffect = lower_comptime.lowerComptimeSideEffect;
pub const lowerComptimeCall = lower_comptime.lowerComptimeCall;
@@ -1705,7 +1705,6 @@ pub const Lowering = struct {
pub const registerErrorSetDecl = lower_nominal.registerErrorSetDecl;
pub const registerStructDecl = lower_nominal.registerStructDecl;
pub const registerEnumDecl = lower_nominal.registerEnumDecl;
pub const reifyType = lower_nominal.reifyType;
pub const registerUnionDecl = lower_nominal.registerUnionDecl;
pub const qualifyAnonType = lower_nominal.qualifyAnonType;
pub const nominalIdOf = lower_nominal.nominalIdOf;
@@ -1869,6 +1868,7 @@ pub const Lowering = struct {
pub const findStructInBody = lower_generic.findStructInBody;
pub const findUnionInBody = lower_generic.findUnionInBody;
pub const findReturnTypeExpr = lower_generic.findReturnTypeExpr;
pub const returnExprMintsType = lower_generic.returnExprMintsType;
pub const genericInstanceMethod = lower_generic.genericInstanceMethod;
pub const ensureGenericInstanceMethodLowered = lower_generic.ensureGenericInstanceMethodLowered;
pub const assertInstanceMapsCoincide = lower_generic.assertInstanceMapsCoincide;