From 171c694f6cc868c070c3e7259a1f54256ea316c4 Mon Sep 17 00:00:00 2001 From: agra Date: Fri, 29 May 2026 22:29:45 +0300 Subject: [PATCH] ir: resolveAstType unhandled-node else arm returns .unresolved, not .s64 A non-type AST node reaching type resolution is a caller bug; returning a plausible .s64 silently fabricated an 8-byte int. Return the .unresolved sentinel so it surfaces (and trips the sizeOf/toLLVMType panic if it ever reaches codegen). The stderr breadcrumb stays. No test exercised this arm (suite unchanged), so nothing was relying on the fabricated s64. --- src/ir/type_bridge.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ir/type_bridge.zig b/src/ir/type_bridge.zig index 8dba6b2..91254d0 100644 --- a/src/ir/type_bridge.zig +++ b/src/ir/type_bridge.zig @@ -50,8 +50,12 @@ pub fn resolveAstType(node: ?*const Node, table: *TypeTable) TypeId { .struct_decl => |sd| resolveInlineStruct(&sd, table), .union_decl => |ud| resolveInlineUnion(&ud, table), else => { - std.debug.print("type_bridge: unhandled node type {s}\n", .{@tagName(n.data)}); - return .s64; + // A non-type AST node reached type resolution — a caller bug. + // Returning a plausible `.s64` would silently fabricate an 8-byte + // int; return the `.unresolved` sentinel so it surfaces (and trips + // the sizeOf/toLLVMType panic if it ever reaches codegen). + std.debug.print("type_bridge: unhandled node type {s} in type position — returning .unresolved\n", .{@tagName(n.data)}); + return .unresolved; }, }; }