mirror of
https://github.com/ziglang/zig.git
synced 2026-01-14 11:25:14 +00:00
stage2 Sema: Add error notes to unresolvable peer types
This commit is contained in:
parent
aad4598367
commit
0bef271e75
11
src/Sema.zig
11
src/Sema.zig
@ -8398,8 +8398,15 @@ fn resolvePeerTypes(
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO error notes pointing out each type
|
||||
return sema.mod.fail(&block.base, src, "incompatible types: '{}' and '{}'", .{ chosen_ty, candidate_ty });
|
||||
const msg = msg: {
|
||||
const msg = try sema.mod.errMsg(&block.base, src, "incompatible types: '{}' and '{}'", .{ chosen_ty, candidate_ty });
|
||||
errdefer msg.destroy(sema.gpa);
|
||||
// TODO add error notes
|
||||
// try sema.mod.errNote(&block.base, chosen.src, msg, "type '{}' here", .{chosen_ty});
|
||||
// try sema.mod.errNote(&block.base, candidate.src, msg, "type '{}' here", .{candidate_ty});
|
||||
break :msg msg;
|
||||
};
|
||||
return sema.mod.failWithOwnedErrorMsg(&block.base, msg);
|
||||
}
|
||||
|
||||
return sema.typeOf(chosen);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user