mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 22:02:45 +01:00
Move common entity fields to a 'base' struct. (#4161)
I'd considered moving DeclParams uses over, but when handling qualified names, there's a parse node instead of an instruction. I did try to unify a couple other uses though, including adding MergeDefinition. I expect `interface` will use a little more once it's more completely implemented, but maybe I'm wrong about that.
This commit is contained in:
@@ -380,6 +380,9 @@ auto DeclNameStack::ResolveAsScope(const NameContext& name_context,
|
||||
name.params_id);
|
||||
|
||||
// Find the scope corresponding to the resolved instruction.
|
||||
// TODO: When diagnosing qualifiers on names, print a diagnostic that talks
|
||||
// about qualifiers instead of redeclarations. Maybe also rename
|
||||
// CheckRedeclParamsMatch.
|
||||
CARBON_KIND_SWITCH(context_->insts().Get(name_context.resolved_inst_id)) {
|
||||
case CARBON_KIND(SemIR::ClassDecl class_decl): {
|
||||
const auto& class_info = context_->classes().Get(class_decl.class_id);
|
||||
@@ -414,6 +417,7 @@ auto DeclNameStack::ResolveAsScope(const NameContext& name_context,
|
||||
case CARBON_KIND(SemIR::Namespace resolved_inst): {
|
||||
auto scope_id = resolved_inst.name_scope_id;
|
||||
auto& scope = context_->name_scopes().Get(scope_id);
|
||||
// This is specifically for qualified name handling.
|
||||
if (!CheckRedeclParamsMatch(
|
||||
*context_, new_params,
|
||||
DeclParams(name_context.resolved_inst_id, Parse::NodeId::Invalid,
|
||||
|
||||
Reference in New Issue
Block a user