mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 06:11:05 +01:00
When diagnosing a duplicate name, point to the name instead of the instruction (#4953)
Left TODOs where more work is necessary before this change can be applied or its impact can be verified. Includes #4952, to avoid regression in some cases. Similar to #4938. See https://discord.com/channels/655572317891461132/655578254970716160/1339007384361762857.
This commit is contained in:
@@ -78,7 +78,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
context.scope_stack().PushCompileTimeBinding(bind_id);
|
||||
}
|
||||
auto name_context =
|
||||
context.decl_name_stack().MakeUnqualifiedName(node_id, name_id);
|
||||
context.decl_name_stack().MakeUnqualifiedName(name_node, name_id);
|
||||
context.decl_name_stack().AddNameOrDiagnose(
|
||||
name_context, bind_id, introducer.modifier_set.GetAccessKind());
|
||||
context.full_pattern_stack().AddBindName(name_id);
|
||||
|
||||
Reference in New Issue
Block a user