mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
When diagnosing poisoned name, point to the declared name instead of the entire declaration (#4938)
See https://discord.com/channels/655572317891461132/655578254970716160/1339007384361762857. Part of #4622.
This commit is contained in:
@@ -175,7 +175,8 @@ auto DeclNameStack::AddNameOrDiagnose(NameContext name_context,
|
||||
SemIR::InstId target_id,
|
||||
SemIR::AccessKind access_kind) -> void {
|
||||
if (name_context.state == DeclNameStack::NameContext::State::Poisoned) {
|
||||
context_->DiagnosePoisonedName(name_context.poisoning_loc_id, target_id);
|
||||
context_->DiagnosePoisonedName(name_context.poisoning_loc_id,
|
||||
name_context.loc_id);
|
||||
} else if (auto id = name_context.prev_inst_id(); id.has_value()) {
|
||||
context_->DiagnoseDuplicateName(target_id, id);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user