P5.7 Step D: delete dead .define builtin arm, defineFromInfo, decodeTypeSlice

Now that define() is sx over register_type, remove the bespoke metatype define
surface from the comptime VM: the .define callBuiltinVm arm, the defineFromInfo
helper (kind-branching minting), and decodeTypeSlice (its only caller). Remove the
BuiltinId.define enum member. The .declare/.define interceptions in lowering and
their BuiltinIds are now gone; only type_info/field_type remain as metatype
builtins. register_type/decodeMemberSlice stay (shared by the sx define and the
compiler-API graph builder).
This commit is contained in:
agra
2026-06-19 21:14:05 +03:00
parent 7b1d8ceb83
commit ccba704378
3 changed files with 13 additions and 138 deletions

View File

@@ -1816,10 +1816,11 @@ pub fn findReturnTypeExpr(body: *const Node) ?*const Node {
/// True when a type-fn's return expression mints a type at comptime and must be
/// run through the interpreter rather than statically resolved. Two shapes:
/// - a call to the `define` construction primitive — `return define(declare(),
/// info)`, the one-shot constructor form; or
/// - a call to the metatype `define` constructor — `return define(declare(),
/// info)`, the one-shot constructor form (now an sx fn over `register_type`,
/// caught here as a fast-path before the `fn_ast_map` lookup below); or
/// - a call to a NON-generic, bodied, `Type`-returning sx fn (a constructor
/// helper that itself ends in `define`).
/// helper that itself ends in `define` / `register_type`).
/// Excludes generic / static type constructors (`Vector(N,T)`, `Make($T)`,
/// `return [K]T`, `return T`), which the static `resolveTypeWithBindings` path
/// handles.
@@ -1828,7 +1829,7 @@ pub fn returnExprMintsType(self: *Lowering, ret: *const Node) bool {
const callee = ret.data.call.callee;
if (callee.data != .identifier) return false;
const name = callee.data.identifier.name;
// The construction terminator builtin — a constructor's final act.
// The construction terminator — a constructor's final act.
if (std.mem.eql(u8, name, "define")) return true;
// A bodied, non-generic, Type-returning sx helper.
const fd = self.program_index.fn_ast_map.get(name) orelse return false;