aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-03-08 14:24:05 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-03-08 14:58:54 -0700
commitfa57335ec64931b2e2b0413fc19cb0b53648cc0b (patch)
tree10367e0c8b6bd626c5f75eddb754fd7665e34dc7 /src/type.zig
parent1046ead0cc409287b88554a90c2f80718e1af46d (diff)
downloadzig-fa57335ec64931b2e2b0413fc19cb0b53648cc0b.tar.gz
zig-fa57335ec64931b2e2b0413fc19cb0b53648cc0b.zip
stage2: implement Type.getOwnerDecl for opaque types
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/type.zig b/src/type.zig
index 6c284f58d4..150ea234a0 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -4683,7 +4683,10 @@ pub const Type = extern union {
const union_obj = ty.cast(Payload.Union).?.data;
return union_obj.owner_decl;
},
- .@"opaque" => @panic("TODO"),
+ .@"opaque" => {
+ const opaque_obj = ty.cast(Payload.Opaque).?.data;
+ return opaque_obj.owner_decl;
+ },
.atomic_order,
.atomic_rmw_op,
.calling_convention,
@@ -4695,7 +4698,8 @@ pub const Type = extern union {
.export_options,
.extern_options,
.type_info,
- => @panic("TODO resolve std.builtin types"),
+ => unreachable, // These need to be resolved earlier.
+
else => unreachable,
}
}