ir: resolveAstType pack-index arm returns .unresolved, not .s64
The pack-aware caller (resolveTypeWithBindings) resolves pack-index type exprs against the active binding before delegating, so reaching this bare type_bridge path means the binding was missing. .s64 silently fabricated an 8-byte int; return the .unresolved sentinel so it surfaces (trips the sizeOf/toLLVMType panic at codegen). Closes the last .s64 escape in resolveAstType.
This commit is contained in:
@@ -34,11 +34,14 @@ pub fn resolveAstType(node: ?*const Node, table: *TypeTable) TypeId {
|
|||||||
.pack_index_type_expr => {
|
.pack_index_type_expr => {
|
||||||
// Pack-index `$args[N]` in a type position must be resolved
|
// Pack-index `$args[N]` in a type position must be resolved
|
||||||
// against an active pack binding — `type_bridge` has no access
|
// against an active pack binding — `type_bridge` has no access
|
||||||
// to that state, so this bare path falls back to .s64 with a
|
// to that state. The pack-aware caller (lowering's
|
||||||
// diagnostic logged. The pack-aware caller (lowering's
|
// `resolveTypeWithBindings`) handles this case directly *before*
|
||||||
// `resolveTypeWithBindings`) handles this case directly.
|
// delegating here, so reaching this bare path means the binding
|
||||||
std.debug.print("type_bridge: pack-index type expression encountered outside a pack-aware context\n", .{});
|
// was missing. `.s64` would silently fabricate an 8-byte int;
|
||||||
return .s64;
|
// 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),
|
.tuple_literal => |tl| resolveTupleLiteralAsType(&tl, table),
|
||||||
.parameterized_type_expr => |pt| resolveParameterizedType(&pt, table),
|
.parameterized_type_expr => |pt| resolveParameterizedType(&pt, table),
|
||||||
|
|||||||
Reference in New Issue
Block a user