Add the used name to the NameUseBeforeDecl diagnostic (#4901)

Part of #4622.
This commit is contained in:
Boaz Brickner
2025-02-14 21:54:35 +00:00
committed by GitHub
parent d65f0d959d
commit 4a93b6667e
11 changed files with 35 additions and 33 deletions
+2 -2
View File
@@ -68,8 +68,8 @@ static auto BuildInterfaceDecl(Context& context,
introducer.modifier_set.GetAccessKind());
if (lookup_result.is_poisoned()) {
// This is a declaration of a poisoned name.
DiagnosePoisonedName(context, lookup_result.poisoning_loc_id(),
name_context.loc_id);
DiagnosePoisonedName(context, name_context.name_id_for_new_inst(),
lookup_result.poisoning_loc_id(), name_context.loc_id);
} else if (lookup_result.is_found()) {
SemIR::InstId existing_id = lookup_result.target_inst_id();
if (auto existing_interface_decl =