mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 10:02:45 +00: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:
1 parent
b78ab1bbae
commit
1aa6573d4e
9 files changed
+39
-38
No files matched your search
@@ -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