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.
This commit is contained in:
agra
2026-05-29 22:29:45 +03:00
parent 55e62694d1
commit 171c694f6c

View File

@@ -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;
},
};
}