Serialization: Bring back shadowing but only after the filtering

Followup fix to #80009. We can still get ambiguities from colliding
decls across modules with the deserialization filtering. Bring back
calling the general lookup shadowing after the filtering. This way it
won't use filtered out decls to hide potential candidates.

rdar://148286345
This commit is contained in:
Alexis Laferrière
2025-04-04 13:39:27 -07:00
parent 2f30161563
commit f4dedc32b5
2 changed files with 56 additions and 0 deletions

View File

@@ -2766,6 +2766,12 @@ giveUpFastPath:
if (M)
return diagnoseFatal();
if (values.size() > 1) {
// Apply shadowing filtering after other local filters so we don't rule out
// valid candidates shadowed by invalid ones.
removeShadowedDecls(values, baseModule);
}
// When all is said and done, we should have a single value here to return.
if (values.size() != 1) {
return llvm::make_error<XRefError>("result is ambiguous", pathTrace,