[NFC] Allow extensions in SynthesizedFileUnits

This commit is contained in:
Becca Royal-Gordon
2021-09-30 15:13:55 -07:00
parent 354f3470a0
commit fa8436bdf6
2 changed files with 8 additions and 5 deletions

View File

@@ -2996,8 +2996,11 @@ void SynthesizedFileUnit::lookupValue(
DeclName name, NLKind lookupKind,
SmallVectorImpl<ValueDecl *> &result) const {
for (auto *decl : TopLevelDecls) {
if (decl->getName().matchesRef(name))
result.push_back(decl);
if (auto VD = dyn_cast<ValueDecl>(decl)) {
if (VD->getName().matchesRef(name)) {
result.push_back(VD);
}
}
}
}