When diagnosing a duplicated name, add the name to the diagnosis (#4902)

In order to have the name available for diagnostics, we now always set
`NameId` in `NameContext` and put `poisoning_loc_id` as part of the
union with `resolved_inst_id` instead (since we never need both).
This commit is contained in:
Boaz Brickner
2025-02-19 07:19:23 +00:00
committed by GitHub
parent e0b2f5d772
commit 6a99c4e970
40 changed files with 104 additions and 96 deletions
+2 -1
View File
@@ -164,7 +164,8 @@ static auto MergeOrAddName(Context& context, Parse::AnyClassDeclId node_id,
if (!prev_class_id.has_value()) {
// This is a redeclaration of something other than a class.
DiagnoseDuplicateName(context, name_context.loc_id, prev_id);
DiagnoseDuplicateName(context, name_context.name_id, name_context.loc_id,
prev_id);
return;
}