authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2021-12-17 04:46:42+01:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2021-12-21 01:41:50+01:00
log993197cd868f312d19ab694dd3a5250e39077f67
tree09cf5f13a01b74f07321f84def9b9bf2d6401111
parent9d6c45f6979543607a7064be7155afa409be956a

stage2: merged error sets in wrapErrorUnion


1 files changed, 7 insertions(+), 0 deletions(-)

src/Sema.zig+7
...@@ -13990,6 +13990,13 @@ fn wrapErrorUnion(...@@ -13990,6 +13990,13 @@ fn wrapErrorUnion(
13990 if (data.errors.contains(expected_name)) break :ok;13990 if (data.errors.contains(expected_name)) break :ok;
13991 return sema.failWithErrorSetCodeMissing(block, inst_src, dest_err_set_ty, inst_ty);13991 return sema.failWithErrorSetCodeMissing(block, inst_src, dest_err_set_ty, inst_ty);
13992 },13992 },
13993 .error_set_merged => {
13994 const expected_name = val.castTag(.@"error").?.data.name;
13995 const error_set = dest_err_set_ty.castTag(.error_set_merged).?.data;
13996 if (!error_set.contains(expected_name)) {
13997 return sema.failWithErrorSetCodeMissing(block, inst_src, dest_err_set_ty, inst_ty);
13998 }
13999 },
13993 else => unreachable,14000 else => unreachable,
13994 }14001 }
13995 return sema.addConstant(dest_ty, val);14002 return sema.addConstant(dest_ty, val);