diff --git a/src/ir/type_bridge.zig b/src/ir/type_bridge.zig index d497951..dfbea28 100644 --- a/src/ir/type_bridge.zig +++ b/src/ir/type_bridge.zig @@ -34,11 +34,14 @@ pub fn resolveAstType(node: ?*const Node, table: *TypeTable) TypeId { .pack_index_type_expr => { // Pack-index `$args[N]` in a type position must be resolved // against an active pack binding — `type_bridge` has no access - // to that state, so this bare path falls back to .s64 with a - // diagnostic logged. The pack-aware caller (lowering's - // `resolveTypeWithBindings`) handles this case directly. - std.debug.print("type_bridge: pack-index type expression encountered outside a pack-aware context\n", .{}); - return .s64; + // to that state. The pack-aware caller (lowering's + // `resolveTypeWithBindings`) handles this case directly *before* + // delegating here, so reaching this bare path means the binding + // was missing. `.s64` would silently fabricate an 8-byte int; + // return `.unresolved` so it surfaces (trips the sizeOf/toLLVMType + // panic at codegen). + std.debug.print("type_bridge: pack-index type expression encountered outside a pack-aware context — returning .unresolved\n", .{}); + return .unresolved; }, .tuple_literal => |tl| resolveTupleLiteralAsType(&tl, table), .parameterized_type_expr => |pt| resolveParameterizedType(&pt, table),