diff options
| author | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2022-02-28 17:40:56 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-02-28 20:42:13 -0700 |
| commit | 5e2e7675d53c4258a21d014a09f2a6fdae64b433 (patch) | |
| tree | 3a807c5deb78314372bf7c32b73cf8bda8d5df8a | |
| parent | 0ce2d46ff9b520ebd09f499cd2caf6e5667f5fa7 (diff) | |
| download | zig-5e2e7675d53c4258a21d014a09f2a6fdae64b433.tar.gz zig-5e2e7675d53c4258a21d014a09f2a6fdae64b433.zip | |
stage2: pass generic poison up the chain in peer type resolution
| -rw-r--r-- | src/Sema.zig | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index b395f85d00..6595f977b2 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -17612,9 +17612,8 @@ fn resolvePeerTypes( var chosen = instructions[0]; var err_set_ty: ?Type = blk: { const chosen_ty = sema.typeOf(chosen); - - // TODO: is this the right handling of generic poison? - if (chosen_ty.tag() == .generic_poison or chosen_ty.zigTypeTag() != .ErrorSet) + const chosen_ty_tag = try chosen_ty.zigTypeTagOrPoison(); + if (chosen_ty_tag != .ErrorSet) break :blk null; // If our chosen type is inferred, we have to resolve it now. |
