mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 08:02:32 +00:00
Sema: fix typo in resolvePeerTypes
This commit is contained in:
parent
e5d4a694ea
commit
98a01f99c9
@ -18910,7 +18910,7 @@ fn resolvePeerTypes(
|
||||
}
|
||||
|
||||
const chosen_set_ty = err_set_ty orelse chosen_ty.errorUnionSet();
|
||||
const candidate_set_ty = chosen_ty.errorUnionSet();
|
||||
const candidate_set_ty = candidate_ty.errorUnionSet();
|
||||
|
||||
if (.ok == try sema.coerceInMemoryAllowedErrorSets(block, chosen_set_ty, candidate_set_ty, src, src)) {
|
||||
err_set_ty = chosen_set_ty;
|
||||
|
@ -626,3 +626,11 @@ test "inferred error set equality" {
|
||||
try expect(BarError == BarError);
|
||||
try expect(BazError == BazError);
|
||||
}
|
||||
|
||||
test "peer type resolution of two different error unions" {
|
||||
const a: error{B}!void = {};
|
||||
const b: error{A}!void = {};
|
||||
var cond = true;
|
||||
const err = if (cond) a else b;
|
||||
try err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user