| ... | ... | @@ -8398,8 +8398,15 @@ fn resolvePeerTypes( |
| 8398 | 8398 | continue; |
| 8399 | 8399 | } |
| 8400 | 8400 | |
| 8401 | | // TODO error notes pointing out each type |
| 8402 | | return sema.mod.fail(&block.base, src, "incompatible types: '{}' and '{}'", .{ chosen_ty, candidate_ty }); |
| 8401 | const msg = msg: { |
| 8402 | const msg = try sema.mod.errMsg(&block.base, src, "incompatible types: '{}' and '{}'", .{ chosen_ty, candidate_ty }); |
| 8403 | errdefer msg.destroy(sema.gpa); |
| 8404 | // TODO add error notes |
| 8405 | // try sema.mod.errNote(&block.base, chosen.src, msg, "type '{}' here", .{chosen_ty}); |
| 8406 | // try sema.mod.errNote(&block.base, candidate.src, msg, "type '{}' here", .{candidate_ty}); |
| 8407 | break :msg msg; |
| 8408 | }; |
| 8409 | return sema.mod.failWithOwnedErrorMsg(&block.base, msg); |
| 8403 | 8410 | } |
| 8404 | 8411 | |
| 8405 | 8412 | return sema.typeOf(chosen); |