mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
When looking up a name in a scope, propagate the lookup result when it's poisoned (#4851)
Instead of creating a new poisoned result. This would allow propagating the poisoning location when we add it. Part of #4622.
This commit is contained in:
@@ -431,9 +431,8 @@ auto Context::LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id,
|
||||
auto lookup_result = scope.GetEntry(*entry_id).result;
|
||||
if (!lookup_result.is_poisoned()) {
|
||||
LoadImportRef(*this, lookup_result.target_inst_id());
|
||||
return lookup_result;
|
||||
}
|
||||
return SemIR::ScopeLookupResult::MakePoisoned();
|
||||
return lookup_result;
|
||||
}
|
||||
|
||||
if (!scope.import_ir_scopes().empty()) {
|
||||
|
||||
Reference in New Issue
Block a user