authorgravatar for mitchell.hashimoto@gmail.comMitchell Hashimoto <mitchell.hashimoto@gmail.com> 2022-03-11 21:36:06-08:00
committergravatar for mitchell.hashimoto@gmail.comMitchell Hashimoto <mitchell.hashimoto@gmail.com> 2022-03-11 21:36:06-08:00
log744b4ad5787edd84aee7b80248350d3313ed8a15
tree0b66653e71d2ab0da86c2acd5410bc894304a698
parent08159be375bf6771f3e2cd73656477504e329f8b
signaturelock-open Commit is signed but in an unrecognized format.

stage2: reify should use pointerDecl to get array value


1 files changed, 3 insertions(+), 3 deletions(-)

src/Sema.zig+3-3
......@@ -12449,7 +12449,7 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
1244912449 const payload_val = union_val.val.optionalValue() orelse
1245012450 return sema.addType(Type.initTag(.anyerror));
1245112451 const slice_val = payload_val.castTag(.slice).?.data;
12452 const decl = slice_val.ptr.castTag(.decl_ref).?.data;
12452 const decl = slice_val.ptr.pointerDecl().?;
1245312453 try sema.ensureDeclAnalyzed(decl);
1245412454 const array_val = decl.val.castTag(.array).?.data;
1245512455
......@@ -12493,7 +12493,7 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I
1249312493
1249412494 // Decls
1249512495 const decls_slice_val = decls_val.castTag(.slice).?.data;
12496 const decls_decl = decls_slice_val.ptr.castTag(.decl_ref).?.data;
12496 const decls_decl = decls_slice_val.ptr.pointerDecl().?;
1249712497 try sema.ensureDeclAnalyzed(decls_decl);
1249812498 if (decls_decl.ty.arrayLen() > 0) {
1249912499 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
1254612546
1254712547 // Fields
1254812548 const slice_val = fields_val.castTag(.slice).?.data;
12549 const decl = slice_val.ptr.castTag(.decl_ref).?.data;
12549 const decl = slice_val.ptr.pointerDecl().?;
1255012550 try sema.ensureDeclAnalyzed(decl);
1255112551 const fields_len = @intCast(usize, decl.ty.arrayLen());
1255212552 if (fields_len > 0) {