diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-10-26 12:03:15 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-10-26 12:03:15 -0700 |
| commit | 6df26a37d13d21be061a1cccd39dd17e46a81322 (patch) | |
| tree | 968733ee0b37a9335cf2a9c4d8fe26874618c671 /src/type.zig | |
| parent | 25012ab3d12ac7bcd4e53a90367afc8e97d91c36 (diff) | |
| download | zig-6df26a37d13d21be061a1cccd39dd17e46a81322.tar.gz zig-6df26a37d13d21be061a1cccd39dd17e46a81322.zip | |
Sema: fix coercion from union to its own tag
I had reversed the tag type / union type arguments.
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/type.zig b/src/type.zig index ca18b182a6..589639ab7f 100644 --- a/src/type.zig +++ b/src/type.zig @@ -2573,6 +2573,19 @@ pub const Type = extern union { pub fn unionTagType(ty: Type) ?Type { return switch (ty.tag()) { .union_tagged => ty.castTag(.union_tagged).?.data.tag_ty, + + .atomic_order, + .atomic_rmw_op, + .calling_convention, + .address_space, + .float_mode, + .reduce_op, + .call_options, + .export_options, + .extern_options, + .type_info, + => unreachable, // needed to call resolveTypeFields first + else => null, }; } |
