P5.7 Step B2: remove the #compiler attribute + compiler_expr AST node

The #compiler struct attribute + #compiler-suffixed bodyless methods were
fully superseded by abi(.compiler) (P5.5) — no sx code uses them.

Remove the hash_compiler token (token/lexer/lsp), the is_compiler_struct /
struct_default_compiler parser machinery + the two compiler_expr body-
synthesis branches, the compiler_expr AST variant, and every
.builtin_expr/.compiler_expr switch arm + == .compiler_expr check across
sema/resolver/semantic_diagnostics/generic/decl/call/calls (kept .builtin_expr).
abi(.compiler) is untouched. Delete the obsolete calls.test.zig dispatch test.

500/500 unit + 706/0 corpus.
This commit is contained in:
agra
2026-06-19 17:18:45 +03:00
parent e2971f272c
commit 64eb01918a
14 changed files with 31 additions and 101 deletions

View File

@@ -282,18 +282,6 @@ pub const CallResolver = struct {
if (oi == .@"struct") {
const struct_name = self.l.module.types.getString(oi.@"struct".name);
const qualified = std.fmt.allocPrint(self.l.alloc, "{s}.{s}", .{ struct_name, cfa.field }) catch cfa.field;
// Generic #compiler method dispatch — return type from declaration.
if (self.l.program_index.fn_ast_map.get(qualified)) |method_fd| {
if (method_fd.body.data == .compiler_expr) {
return .{
.kind = .struct_method,
.return_type = if (method_fd.return_type) |rt| type_bridge.resolveAstType(rt, &self.l.module.types, &self.l.program_index.type_alias_map, &self.l.program_index.module_const_map) else .void,
.target = .{ .named = qualified },
.prepends_receiver = true,
.expands_defaults = defaultsFor(method_fd, c.args.len + 1),
};
}
}
if (self.l.resolveFuncByName(qualified)) |fid| {
const func = &self.l.module.functions.items[@intFromEnum(fid)];
return .{