Skip to content

Commit 51d7e63

Browse files
authored
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.
1 parent 5abe5a3 commit 51d7e63

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

toolchain/check/context.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,8 @@ auto Context::LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id,
431431
auto lookup_result = scope.GetEntry(*entry_id).result;
432432
if (!lookup_result.is_poisoned()) {
433433
LoadImportRef(*this, lookup_result.target_inst_id());
434-
return lookup_result;
435434
}
436-
return SemIR::ScopeLookupResult::MakePoisoned();
435+
return lookup_result;
437436
}
438437

439438
if (!scope.import_ir_scopes().empty()) {

0 commit comments

Comments
 (0)