Skip to content

Commit ca117dd

Browse files
committed
[Name lookup] Be more tolerant of missing interface types.
Fixes two crashers that regressed with the reimplementation of typo correction for nested types of dependent types, and addresses one more existing crasher.
1 parent d5a55d9 commit ca117dd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/AST/LookupVisibleDecls.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,13 @@ class OverrideFilteringConsumer : public VisibleDeclConsumer {
798798
VD->getDeclContext()->isTypeContext());
799799
ModuleDecl *M = DC->getParentModule();
800800

801+
// Hack; we shouldn't be filtering at this level anyway.
802+
if (!VD->hasInterfaceType()) {
803+
FoundDecls[VD->getBaseName()].insert(VD);
804+
DeclsToReport.insert(FoundDeclTy(VD, Reason));
805+
return;
806+
}
807+
801808
auto FoundSignature = VD->getOverloadSignature();
802809
if (FoundSignature.InterfaceType && shouldSubst &&
803810
shouldSubstIntoDeclType(FoundSignature.InterfaceType)) {
@@ -809,7 +816,7 @@ class OverrideFilteringConsumer : public VisibleDeclConsumer {
809816
for (auto I = PossiblyConflicting.begin(), E = PossiblyConflicting.end();
810817
I != E; ++I) {
811818
auto *OtherVD = *I;
812-
if (OtherVD->isInvalid()) {
819+
if (OtherVD->isInvalid() || !OtherVD->hasInterfaceType()) {
813820
// For some invalid decls it might be impossible to compute the
814821
// signature, for example, if the types could not be resolved.
815822
continue;

0 commit comments

Comments
 (0)