aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-03-11 21:36:06 -0800
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-03-11 21:36:06 -0800
commit744b4ad5787edd84aee7b80248350d3313ed8a15 (patch)
tree0b66653e71d2ab0da86c2acd5410bc894304a698 /src/Sema.zig
parent08159be375bf6771f3e2cd73656477504e329f8b (diff)
downloadzig-744b4ad5787edd84aee7b80248350d3313ed8a15.tar.gz
zig-744b4ad5787edd84aee7b80248350d3313ed8a15.zip
stage2: reify should use pointerDecl to get array value
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index b304eab99d..5d729cba30 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -12449,7 +12449,7 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
const payload_val = union_val.val.optionalValue() orelse
return sema.addType(Type.initTag(.anyerror));
const slice_val = payload_val.castTag(.slice).?.data;
- const decl = slice_val.ptr.castTag(.decl_ref).?.data;
+ const decl = slice_val.ptr.pointerDecl().?;
try sema.ensureDeclAnalyzed(decl);
const array_val = decl.val.castTag(.array).?.data;
@@ -12493,7 +12493,7 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
// Decls
const decls_slice_val = decls_val.castTag(.slice).?.data;
- const decls_decl = decls_slice_val.ptr.castTag(.decl_ref).?.data;
+ const decls_decl = decls_slice_val.ptr.pointerDecl().?;
try sema.ensureDeclAnalyzed(decls_decl);
if (decls_decl.ty.arrayLen() > 0) {
return sema.fail(block, src, "reified enums must have no decls", .{});
@@ -12546,7 +12546,7 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
// Fields
const slice_val = fields_val.castTag(.slice).?.data;
- const decl = slice_val.ptr.castTag(.decl_ref).?.data;
+ const decl = slice_val.ptr.pointerDecl().?;
try sema.ensureDeclAnalyzed(decl);
const fields_len = @intCast(usize, decl.ty.arrayLen());
if (fields_len > 0) {