aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorIan Johnson <ian@ianjohnson.dev>2025-03-03 21:57:52 -0500
committerAndrew Kelley <andrew@ziglang.org>2025-03-08 14:29:20 -0500
commit0bce4a4e05ef377b82667997870e73a11dc98c88 (patch)
treed3c72bd340e8df7bd03b41613c6416275f50f769 /src/Sema.zig
parent61c588d726f85551ad36c32fd2917087d3a4763b (diff)
downloadzig-0bce4a4e05ef377b82667997870e73a11dc98c88.tar.gz
zig-0bce4a4e05ef377b82667997870e73a11dc98c88.zip
Sema: handle generated tag enums in union field order check
Fixes #23059 The "note: enum field here" now references the field in the base union type rather than crashing.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index b30f42c2d7..e4a0532b67 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -36719,7 +36719,7 @@ fn unionFields(
if (enum_index != field_i) {
const msg = msg: {
const enum_field_src: LazySrcLoc = .{
- .base_node_inst = tag_info.zir_index.unwrap().?,
+ .base_node_inst = Type.fromInterned(tag_ty).typeDeclInstAllowGeneratedTag(zcu).?,
.offset = .{ .container_field_name = enum_index },
};
const msg = try sema.errMsg(name_src, "union field '{}' ordered differently than corresponding enum field", .{