aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 454722728b..64b4bf97db 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -22476,13 +22476,12 @@ fn fieldVal(
);
},
.Union => {
- const union_ty = try sema.resolveTypeFields(child_type);
-
- if (union_ty.getNamespace()) |namespace| {
+ if (child_type.getNamespace()) |namespace| {
if (try sema.namespaceLookupVal(block, src, namespace, field_name)) |inst| {
return inst;
}
}
+ const union_ty = try sema.resolveTypeFields(child_type);
if (union_ty.unionTagType()) |enum_ty| {
if (enum_ty.enumFieldIndex(field_name)) |field_index_usize| {
const field_index = @intCast(u32, field_index_usize);