authorgravatar for mitchell.hashimoto@gmail.comMitchell Hashimoto <mitchell.hashimoto@gmail.com> 2022-02-28 17:40:56-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-02-28 20:42:13-07:00
log5e2e7675d53c4258a21d014a09f2a6fdae64b433
tree3a807c5deb78314372bf7c32b73cf8bda8d5df8a
parent0ce2d46ff9b520ebd09f499cd2caf6e5667f5fa7

stage2: pass generic poison up the chain in peer type resolution


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

src/Sema.zig+2-3
...@@ -17612,9 +17612,8 @@ fn resolvePeerTypes(...@@ -17612,9 +17612,8 @@ fn resolvePeerTypes(
17612 var chosen = instructions[0];17612 var chosen = instructions[0];
17613 var err_set_ty: ?Type = blk: {17613 var err_set_ty: ?Type = blk: {
17614 const chosen_ty = sema.typeOf(chosen);17614 const chosen_ty = sema.typeOf(chosen);
1761517615 const chosen_ty_tag = try chosen_ty.zigTypeTagOrPoison();
17616 // TODO: is this the right handling of generic poison?17616 if (chosen_ty_tag != .ErrorSet)
17617 if (chosen_ty.tag() == .generic_poison or chosen_ty.zigTypeTag() != .ErrorSet)
17618 break :blk null;17617 break :blk null;
1761917618
17620 // If our chosen type is inferred, we have to resolve it now.17619 // If our chosen type is inferred, we have to resolve it now.