authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-04-21 06:39:50-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2026-04-24 11:08:01-04:00
log57a8af2272f9116d43bcd9b3d8942ea58ccc1398
treef9db6b475348bbaceb6175580f2b019a0986c846
parent20e7929f6db4404ee343d993aa3d483e9a7ac71f

Sema: more restricted type support


4 files changed, 65 insertions(+), 73 deletions(-)

src/Sema.zig+53-64
......@@ -926,6 +926,12 @@ const ComptimeReason = union(enum) {
926926 comptime_src: LazySrcLoc,
927927 },
928928
929 /// Evaluating at comptime because we're coercing to a restricted type.
930 restricted_coercion: struct {
931 restricted_ty: Type,
932 unrestricted_ty: Type,
933 },
934
929935 fn explain(reason: ComptimeReason, sema: *Sema, src: LazySrcLoc, err_msg: *Zcu.ErrorMsg) !void {
930936 switch (reason) {
931937 .simple => |simple| {
......@@ -955,6 +961,12 @@ const ComptimeReason = union(enum) {
955961 try sema.errNote(src, err_msg, "argument to comptime parameter must be comptime-known", .{});
956962 try sema.errNote(cp.comptime_src, err_msg, "parameter declared comptime here", .{});
957963 },
964 .restricted_coercion => |rc| {
965 try sema.errNote(src, err_msg, "coercion to restricted type '{f}' from underlying type '{f}' must be comptime-known", .{
966 rc.restricted_ty.fmt(sema.pt), rc.unrestricted_ty.fmt(sema.pt),
967 });
968 try sema.addDeclaredHereNote(err_msg, rc.restricted_ty);
969 },
958970 }
959971 }
960972};
......@@ -4156,7 +4168,7 @@ fn zirCoercePtrElemTy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileE
41564168 const extra = sema.code.extraData(Zir.Inst.Bin, pl_node.payload_index).data;
41574169 const uncoerced_val = sema.resolveInst(extra.rhs);
41584170 const maybe_wrapped_ptr_ty = try sema.resolveTypeOrPoison(block, LazySrcLoc.unneeded, extra.lhs) orelse return uncoerced_val;
4159 const ptr_ty = maybe_wrapped_ptr_ty.optEuBaseType(zcu);
4171 const ptr_ty = maybe_wrapped_ptr_ty.restrictedOptEuBaseType(zcu);
41604172 assert(ptr_ty.zigTypeTag(zcu) == .pointer); // validated by a previous instruction
41614173 const elem_ty = ptr_ty.childType(zcu);
41624174 switch (ptr_ty.ptrSize(zcu)) {
......@@ -4255,7 +4267,7 @@ fn zirValidateRefTy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileErr
42554267 // In case of GenericPoison, we don't actually have a type, so this will be
42564268 // treated as an untyped address-of operator.
42574269 const ty_operand = try sema.resolveTypeOrPoison(block, src, un_tok.operand) orelse return;
4258 if (ty_operand.optEuBaseType(zcu).zigTypeTag(zcu) != .pointer) {
4270 if (ty_operand.restrictedOptEuBaseType(zcu).zigTypeTag(zcu) != .pointer) {
42594271 return sema.failWithOwnedErrorMsg(block, msg: {
42604272 const msg = try sema.errMsg(src, "expected type '{f}', found pointer", .{ty_operand.fmt(pt)});
42614273 errdefer msg.destroy(sema.gpa);
......@@ -4287,7 +4299,7 @@ fn zirValidateArrayInitRefTy(
42874299 const src = block.nodeOffset(pl_node.src_node);
42884300 const extra = sema.code.extraData(Zir.Inst.ArrayInitRefTy, pl_node.payload_index).data;
42894301 const maybe_wrapped_ptr_ty = try sema.resolveTypeOrPoison(block, LazySrcLoc.unneeded, extra.ptr_ty) orelse return .generic_poison_type;
4290 const ptr_ty = maybe_wrapped_ptr_ty.optEuBaseType(zcu);
4302 const ptr_ty = maybe_wrapped_ptr_ty.restrictedOptEuBaseType(zcu);
42914303 assert(ptr_ty.zigTypeTag(zcu) == .pointer); // validated by a previous instruction
42924304 switch (zcu.intern_pool.indexToKey(ptr_ty.toIntern())) {
42934305 .ptr_type => |ptr_type| switch (ptr_type.flags.size) {
......@@ -4310,7 +4322,7 @@ fn zirValidateArrayInitRefTy(
43104322 // The actual array type is unknown, which we represent with a generic poison.
43114323 return .generic_poison_type;
43124324 }
4313 const arr_ty = ret_ty.optEuBaseType(zcu);
4325 const arr_ty = ret_ty.restrictedOptEuBaseType(zcu);
43144326 try sema.validateArrayInitTy(block, src, src, extra.elem_count, arr_ty);
43154327 return Air.internedToRef(ret_ty.toIntern());
43164328}
......@@ -4329,7 +4341,7 @@ fn zirValidateArrayInitTy(
43294341 const extra = sema.code.extraData(Zir.Inst.ArrayInit, inst_data.payload_index).data;
43304342 // It's okay for the type to be poison: this will result in an anonymous array init.
43314343 const ty = try sema.resolveTypeOrPoison(block, ty_src, extra.ty) orelse return;
4332 const arr_ty = if (is_result_ty) ty.optEuBaseType(zcu) else ty;
4344 const arr_ty = if (is_result_ty) ty.restrictedOptEuBaseType(zcu) else ty;
43334345 return sema.validateArrayInitTy(block, src, ty_src, extra.init_count, arr_ty);
43344346}
43354347
......@@ -4388,7 +4400,7 @@ fn zirValidateStructInitTy(
43884400 const src = block.nodeOffset(inst_data.src_node);
43894401 // It's okay for the type to be poison: this will result in an anonymous struct init.
43904402 const ty = try sema.resolveTypeOrPoison(block, src, inst_data.operand) orelse return;
4391 const struct_ty = if (is_result_ty) ty.optEuBaseType(zcu) else ty;
4403 const struct_ty = if (is_result_ty) ty.restrictedOptEuBaseType(zcu) else ty;
43924404
43934405 switch (struct_ty.zigTypeTag(zcu)) {
43944406 .@"struct", .@"union" => return,
......@@ -4414,7 +4426,7 @@ fn zirValidatePtrStructInit(
44144426 const field_ptr_data = sema.code.instructions.items(.data)[@intFromEnum(instrs[0])].pl_node;
44154427 const field_ptr_extra = sema.code.extraData(Zir.Inst.Field, field_ptr_data.payload_index).data;
44164428 const object_ptr = sema.resolveInst(field_ptr_extra.lhs);
4417 const agg_ty = sema.typeOf(object_ptr).childType(zcu).optEuBaseType(zcu);
4429 const agg_ty = sema.typeOf(object_ptr).childType(zcu).restrictedOptEuBaseType(zcu);
44184430 switch (agg_ty.zigTypeTag(zcu)) {
44194431 .@"struct" => return sema.validateStructInit(
44204432 block,
......@@ -4580,7 +4592,7 @@ fn zirValidatePtrArrayInit(
45804592 const first_elem_ptr_data = sema.code.instructions.items(.data)[@intFromEnum(instrs[0])].pl_node;
45814593 const elem_ptr_extra = sema.code.extraData(Zir.Inst.ElemPtrImm, first_elem_ptr_data.payload_index).data;
45824594 const array_ptr = sema.resolveInst(elem_ptr_extra.ptr);
4583 const array_ty = sema.typeOf(array_ptr).childType(zcu).optEuBaseType(zcu);
4595 const array_ty = sema.typeOf(array_ptr).childType(zcu).restrictedOptEuBaseType(zcu);
45844596 const array_len = array_ty.arrayLen(zcu);
45854597
45864598 // Analagously to `validateStructInit`, our job is to handle default fields; either emitting AIR
......@@ -4705,21 +4717,14 @@ fn failWithBadMemberAccess(
47054717 const pt = sema.pt;
47064718 const zcu = pt.zcu;
47074719 const ip = &zcu.intern_pool;
4708 const kw_name = switch (agg_ty.zigTypeTag(zcu)) {
4709 .@"union" => "union",
4710 .@"struct" => "struct",
4711 .@"opaque" => "opaque",
4712 .@"enum" => "enum",
4713 else => unreachable,
4714 };
47154720 if (agg_ty.typeDeclInst(zcu)) |inst| if ((inst.resolve(ip) orelse return error.AnalysisFail) == .main_struct_inst) {
47164721 return sema.fail(block, field_src, "root source file struct '{f}' has no member named '{f}'", .{
47174722 agg_ty.fmt(pt), field_name.fmt(ip),
47184723 });
47194724 };
47204725
4721 return sema.fail(block, field_src, "{s} '{f}' has no member named '{f}'", .{
4722 kw_name, agg_ty.fmt(pt), field_name.fmt(ip),
4726 return sema.fail(block, field_src, "{t} '{f}' has no member named '{f}'", .{
4727 agg_ty.zigTypeTag(zcu), agg_ty.fmt(pt), field_name.fmt(ip),
47234728 });
47244729}
47254730
......@@ -4777,13 +4782,7 @@ fn failWithBadUnionFieldAccess(
47774782pub fn addDeclaredHereNote(sema: *Sema, parent: *Zcu.ErrorMsg, decl_ty: Type) !void {
47784783 const zcu = sema.pt.zcu;
47794784 const src_loc = decl_ty.srcLocOrNull(zcu) orelse return;
4780 const category = switch (decl_ty.zigTypeTag(zcu)) {
4781 .@"union" => "union",
4782 .@"struct" => "struct",
4783 .@"enum" => "enum",
4784 .@"opaque" => "opaque",
4785 else => unreachable,
4786 };
4785 const category = if (zcu.intern_pool.isRestrictedType(decl_ty.toIntern())) "restricted type" else @tagName(decl_ty.zigTypeTag(zcu));
47874786 try sema.errNote(src_loc, parent, "{s} declared here", .{category});
47884787}
47894788
......@@ -7420,7 +7419,7 @@ fn zirArrayInitElemType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Compil
74207419 const zcu = pt.zcu;
74217420 const bin = sema.code.instructions.items(.data)[@intFromEnum(inst)].bin;
74227421 const maybe_wrapped_indexable_ty = try sema.resolveTypeOrPoison(block, LazySrcLoc.unneeded, bin.lhs) orelse return .generic_poison_type;
7423 const indexable_ty = maybe_wrapped_indexable_ty.optEuBaseType(zcu);
7422 const indexable_ty = maybe_wrapped_indexable_ty.restrictedOptEuBaseType(zcu);
74247423 assert(indexable_ty.isIndexable(zcu)); // validated by a previous instruction
74257424 const elem_ty = switch (indexable_ty.zigTypeTag(zcu)) {
74267425 .@"struct" => indexable_ty.fieldType(@intFromEnum(bin.rhs), zcu),
......@@ -7434,7 +7433,7 @@ fn zirElemType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
74347433 const zcu = pt.zcu;
74357434 const un_node = sema.code.instructions.items(.data)[@intFromEnum(inst)].un_node;
74367435 const maybe_wrapped_ptr_ty = try sema.resolveTypeOrPoison(block, LazySrcLoc.unneeded, un_node.operand) orelse return .generic_poison_type;
7437 const ptr_ty = maybe_wrapped_ptr_ty.optEuBaseType(zcu);
7436 const ptr_ty = maybe_wrapped_ptr_ty.restrictedOptEuBaseType(zcu);
74387437 assert(ptr_ty.zigTypeTag(zcu) == .pointer); // validated by a previous instruction
74397438 const elem_ty = ptr_ty.childType(zcu);
74407439 if (elem_ty.toIntern() == .anyopaque_type) {
......@@ -7465,7 +7464,7 @@ fn zirSplatOpResultType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Compil
74657464 const un_node = sema.code.instructions.items(.data)[@intFromEnum(inst)].un_node;
74667465
74677466 const raw_ty = try sema.resolveTypeOrPoison(block, LazySrcLoc.unneeded, un_node.operand) orelse return .generic_poison_type;
7468 const vec_ty = raw_ty.optEuBaseType(zcu);
7467 const vec_ty = raw_ty.restrictedOptEuBaseType(zcu);
74697468
74707469 switch (vec_ty.zigTypeTag(zcu)) {
74717470 .array, .vector => {},
......@@ -9451,13 +9450,8 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
94519450 return sema.failWithOwnedErrorMsg(block, msg);
94529451 },
94539452 .@"struct", .@"union" => if (dest_ty.containerLayout(zcu) == .auto) {
9454 const container = switch (dest_ty.zigTypeTag(zcu)) {
9455 .@"struct" => "struct",
9456 .@"union" => "union",
9457 else => unreachable,
9458 };
9459 return sema.fail(block, src, "cannot @bitCast to '{f}'; {s} does not have a guaranteed in-memory layout", .{
9460 dest_ty.fmt(pt), container,
9453 return sema.fail(block, src, "cannot @bitCast to '{f}'; {t} does not have a guaranteed in-memory layout", .{
9454 dest_ty.fmt(pt), dest_ty.zigTypeTag(zcu),
94619455 });
94629456 },
94639457 .array => {
......@@ -9525,13 +9519,8 @@ fn zirBitcast(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
95259519 return sema.failWithOwnedErrorMsg(block, msg);
95269520 },
95279521 .@"struct", .@"union" => if (operand_ty.containerLayout(zcu) == .auto) {
9528 const container = switch (operand_ty.zigTypeTag(zcu)) {
9529 .@"struct" => "struct",
9530 .@"union" => "union",
9531 else => unreachable,
9532 };
9533 return sema.fail(block, operand_src, "cannot @bitCast from '{f}'; {s} does not have a guaranteed in-memory layout", .{
9534 operand_ty.fmt(pt), container,
9522 return sema.fail(block, operand_src, "cannot @bitCast from '{f}'; {t} does not have a guaranteed in-memory layout", .{
9523 operand_ty.fmt(pt), operand_ty.zigTypeTag(zcu),
95359524 });
95369525 },
95379526 .array => {
......@@ -17857,7 +17846,7 @@ fn zirRetImplicit(
1785717846
1785817847 const operand = sema.resolveInst(inst_data.operand);
1785917848 const ret_ty_src = block.src(.{ .node_offset_fn_type_ret_ty = .zero });
17860 const base_tag = sema.fn_ret_ty.optEuBaseType(zcu).zigTypeTag(zcu);
17849 const base_tag = sema.fn_ret_ty.restrictedOptEuBaseType(zcu).zigTypeTag(zcu);
1786117850 if (base_tag == .noreturn) {
1786217851 const msg = msg: {
1786317852 const msg = try sema.errMsg(ret_ty_src, "function declared '{f}' implicitly returns", .{
......@@ -18372,7 +18361,7 @@ fn zirStructInitEmptyResult(sema: *Sema, block: *Block, inst: Zir.Inst.Index, is
1837218361 };
1837318362
1837418363 const init_ty = if (is_byref) ty: {
18375 const ptr_ty = ty_operand.optEuBaseType(zcu);
18364 const ptr_ty = ty_operand.restrictedOptEuBaseType(zcu);
1837618365 assert(ptr_ty.zigTypeTag(zcu) == .pointer); // validated by a previous instruction
1837718366 switch (ptr_ty.ptrSize(zcu)) {
1837818367 // Use a zero-length array for a slice or many-ptr result
......@@ -18409,7 +18398,7 @@ fn zirStructInitEmptyResult(sema: *Sema, block: *Block, inst: Zir.Inst.Index, is
1840918398
1841018399 try sema.ensureLayoutResolved(init_ty, src, .init);
1841118400
18412 const obj_ty = init_ty.optEuBaseType(zcu);
18401 const obj_ty = init_ty.restrictedOptEuBaseType(zcu);
1841318402
1841418403 const empty_ref = switch (obj_ty.zigTypeTag(zcu)) {
1841518404 .@"struct" => try sema.structInitEmpty(block, obj_ty, src, src),
......@@ -18527,7 +18516,7 @@ fn zirStructInit(
1852718516 return sema.structInitAnon(block, src, inst, .typed_init, extra.data, extra.end, is_ref);
1852818517 };
1852918518 try sema.ensureLayoutResolved(result_ty, src, .init);
18530 const resolved_ty = result_ty.optEuBaseType(zcu);
18519 const resolved_ty = result_ty.restrictedOptEuBaseType(zcu);
1853118520
1853218521 if (resolved_ty.zigTypeTag(zcu) == .@"struct") {
1853318522 // This logic must be synchronized with that in `zirStructInitEmpty`.
......@@ -19065,7 +19054,7 @@ fn zirArrayInit(
1906519054 // The type wasn't actually known, so treat this as an anon array init.
1906619055 return sema.arrayInitAnon(block, src, args[1..], is_ref);
1906719056 };
19068 const array_ty = result_ty.optEuBaseType(zcu);
19057 const array_ty = result_ty.restrictedOptEuBaseType(zcu);
1906919058 const is_tuple = array_ty.zigTypeTag(zcu) == .@"struct";
1907019059 const sentinel_val = array_ty.sentinel(zcu);
1907119060
......@@ -19330,7 +19319,7 @@ fn zirStructInitFieldType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) Comp
1933019319 const ty_src = block.nodeOffset(inst_data.src_node);
1933119320 const field_name_src = block.src(.{ .node_offset_field_name_init = inst_data.src_node });
1933219321 const wrapped_aggregate_ty = try sema.resolveTypeOrPoison(block, ty_src, extra.container_type) orelse return .generic_poison_type;
19333 const aggregate_ty = wrapped_aggregate_ty.optEuBaseType(zcu);
19322 const aggregate_ty = wrapped_aggregate_ty.restrictedOptEuBaseType(zcu);
1933419323 const zir_field_name = sema.code.nullTerminatedString(extra.name_start);
1933519324 const field_name = try ip.getOrPutString(gpa, io, pt.tid, zir_field_name, .no_embedded_nulls);
1933619325 try sema.ensureLayoutResolved(aggregate_ty, ty_src, .init);
......@@ -20871,7 +20860,7 @@ fn zirRoundCast(
2087120860 .truncate => return sema.unaryMath(block, operand_src, operand, .trunc_float, Value.trunc),
2087220861 // zig fmt: on
2087320862 .exact => unreachable,
20874 }).optEuBaseType(zcu);
20863 }).restrictedOptEuBaseType(zcu);
2087520864
2087620865 const operand_ty = sema.typeOf(operand);
2087720866
......@@ -25081,7 +25070,7 @@ fn zirFloatOpResultType(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.
2508125070 const operand_src = block.builtinCallArgSrc(extra.node, 0);
2508225071
2508325072 const raw_ty = try sema.resolveTypeOrPoison(block, operand_src, extra.operand) orelse return .generic_poison_type;
25084 const float_ty = raw_ty.optEuBaseType(zcu);
25073 const float_ty = raw_ty.restrictedOptEuBaseType(zcu);
2508525074
2508625075 switch (float_ty.scalarType(zcu).zigTypeTag(zcu)) {
2508725076 .float, .comptime_float => {},
......@@ -25106,7 +25095,7 @@ fn zirRoundOpType(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstDa
2510625095 return .generic_poison_type;
2510725096 };
2510825097
25109 const float_ty = dest_ty.optEuBaseType(zcu);
25098 const float_ty = dest_ty.restrictedOptEuBaseType(zcu);
2511025099 switch (float_ty.scalarType(zcu).zigTypeTag(zcu)) {
2511125100 .float, .comptime_float => return .fromType(float_ty),
2511225101 else => return .comptime_float_type,
......@@ -27479,21 +27468,21 @@ fn coerceExtra(
2747927468 if (dest_ty.eql(inst_ty, zcu))
2748027469 return inst;
2748127470
27482 const maybe_inst_val = sema.resolveValue(inst);
27483
2748427471 // Restricted coercions
27485 if (maybe_inst_val != null) {
27486 if (dest_ty.unrestrictedType(zcu)) |dest_unrestricted_ty| {
27487 if (sema.resolveValue(try sema.coerceExtra(block, dest_unrestricted_ty, inst, inst_src, opts))) |dest_unrestricted_val| {
27488 return .fromIntern(try pt.intern(if (dest_unrestricted_val.isUndef(zcu)) .{
27489 .undef = dest_ty.toIntern(),
27490 } else .{ .restricted_value = .{
27491 .ty = dest_ty.toIntern(),
27492 .unrestricted_value = dest_unrestricted_val.toIntern(),
27493 } }));
27494 }
27495 }
27472 if (dest_ty.unrestrictedType(zcu)) |dest_unrestricted_ty| {
27473 const dest_unrestricted = try sema.coerceExtra(block, dest_unrestricted_ty, inst, inst_src, opts);
27474 const dest_unrestricted_val = try sema.resolveConstValue(block, inst_src, dest_unrestricted, .{ .restricted_coercion = .{
27475 .restricted_ty = dest_ty,
27476 .unrestricted_ty = dest_unrestricted_ty,
27477 } });
27478 return .fromIntern(try pt.intern(if (dest_unrestricted_val.isUndef(zcu)) .{
27479 .undef = dest_ty.toIntern(),
27480 } else .{ .restricted_value = .{
27481 .ty = dest_ty.toIntern(),
27482 .unrestricted_value = dest_unrestricted_val.toIntern(),
27483 } }));
2749627484 }
27485 const maybe_inst_val = sema.resolveValue(inst);
2749727486 if (inst_ty.unrestrictedType(zcu)) |inst_unrestricted_ty| {
2749827487 const unrestricted_inst: Air.Inst.Ref = if (maybe_inst_val) |inst_val|
2749927488 .fromIntern(ip.indexToKey(inst_val.toIntern()).restricted_value.unrestricted_value)
......@@ -28268,7 +28257,7 @@ const InMemoryCoercionResult = union(enum) {
2826828257 for ([_]Type{ pair.actual, pair.wanted }) |restricted_type| {
2826928258 try sema.addDeclaredHereNote(msg, restricted_type);
2827028259 const unrestricted_type = restricted_type.unrestrictedType(pt.zcu) orelse continue;
28271 try sema.errNote(src, msg, "restricted type '{f}' is not guaranteed to have the same representation as its unrestricted type '{f}'", .{
28260 try sema.errNote(src, msg, "restricted type '{f}' has a different representation than unrestricted type '{f}'", .{
2827228261 restricted_type.fmt(pt), unrestricted_type.fmt(pt),
2827328262 });
2827428263 }
src/Type.zig+10-7
......@@ -2701,15 +2701,18 @@ pub fn isTuple(ty: Type, zcu: *const Zcu) bool {
27012701 };
27022702}
27032703
2704/// Traverses optional child types and error union payloads until the type is neither of those.
2704/// Traverses restricted unrestricted types, optional child types, and error union payloads until the type is neither of those.
27052705/// For `E!?u32`, returns `u32`; for `*u8`, returns `*u8`.
2706pub fn optEuBaseType(ty: Type, zcu: *const Zcu) Type {
2706pub fn restrictedOptEuBaseType(ty: Type, zcu: *const Zcu) Type {
27072707 var cur = ty;
2708 while (true) switch (cur.zigTypeTag(zcu)) {
2709 .optional => cur = cur.optionalChild(zcu),
2710 .error_union => cur = cur.errorUnionPayload(zcu),
2711 else => return cur,
2712 };
2708 while (true) {
2709 cur = ty.unrestrictedType(zcu) orelse cur;
2710 switch (cur.zigTypeTag(zcu)) {
2711 .optional => cur = cur.optionalChild(zcu),
2712 .error_union => cur = cur.errorUnionPayload(zcu),
2713 else => return cur,
2714 }
2715 }
27132716}
27142717
27152718pub fn toUnsigned(ty: Type, pt: Zcu.PerThread) !Type {
src/link/Coff.zig+1-1
......@@ -2474,7 +2474,7 @@ pub fn printNode(
24742474 val.fmtValue(.{ .zcu = zcu, .tid = tid }),
24752475 });
24762476 },
2477 inline .lazy_code, .lazy_const_data => |lmi| try w.print("({f})", .{
2477 inline .lazy_code, .lazy_const_data, .lazy_deferred_const_data => |lmi| try w.print("({f})", .{
24782478 Value.fromInterned(lmi.lazySymbol(coff).key).fmtValue(
24792479 .{ .zcu = coff.base.comp.zcu.?, .tid = tid },
24802480 ),
src/link/Elf2.zig+1-1
......@@ -3837,7 +3837,7 @@ pub fn printNode(
38373837 val.fmtValue(.{ .zcu = zcu, .tid = tid }),
38383838 });
38393839 },
3840 inline .lazy_code, .lazy_const_data => |lmi| try w.print("({f})", .{
3840 inline .lazy_code, .lazy_const_data, .lazy_deferred_const_data => |lmi| try w.print("({f})", .{
38413841 Value.fromInterned(lmi.lazySymbol(elf).key).fmtValue(
38423842 .{ .zcu = elf.base.comp.zcu.?, .tid = tid },
38433843 ),