Refactor name lookup logic out of Context (#4930)

This is a pretty straight move of name lookup functionality to
name_lookup.*
This commit is contained in:
Jon Ross-Perkins
2025-02-12 22:03:08 +00:00
committed by GitHub
parent c6d35e1c4a
commit afef6cd940
15 changed files with 622 additions and 576 deletions
+2 -1
View File
@@ -6,6 +6,7 @@
#include "toolchain/check/convert.h"
#include "toolchain/check/handle.h"
#include "toolchain/check/interface.h"
#include "toolchain/check/name_lookup.h"
#include "toolchain/check/return.h"
#include "toolchain/check/subpattern.h"
#include "toolchain/check/type_completion.h"
@@ -226,7 +227,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
break;
}
if (had_error) {
context.AddNameToLookup(name_id, SemIR::ErrorInst::SingletonInstId);
AddNameToLookup(context, name_id, SemIR::ErrorInst::SingletonInstId);
// Replace the parameter with `ErrorInst` so that we don't try
// constructing a generic based on it.
param_pattern_id = SemIR::ErrorInst::SingletonInstId;