aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Sema.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 2dba678931..ddcdecb6b4 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -29761,6 +29761,25 @@ fn resolvePeerTypes(
continue;
}
},
+ .ErrorSet => {
+ chosen = candidate;
+ chosen_i = candidate_i + 1;
+ if (err_set_ty) |chosen_set_ty| {
+ if (.ok == try sema.coerceInMemoryAllowedErrorSets(block, chosen_set_ty, chosen_ty, src, src)) {
+ continue;
+ }
+ if (.ok == try sema.coerceInMemoryAllowedErrorSets(block, chosen_ty, chosen_set_ty, src, src)) {
+ err_set_ty = chosen_ty;
+ continue;
+ }
+
+ err_set_ty = try chosen_set_ty.errorSetMerge(sema.arena, chosen_ty);
+ continue;
+ } else {
+ err_set_ty = chosen_ty;
+ continue;
+ }
+ },
else => {},
}