@@ -850,7 +850,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
850
850
// and if so, whether this is a reference to one of them.
851
851
while (!DC->isModuleScopeContext ()) {
852
852
GenericParamList *GenericParams = nullptr ;
853
- const ValueDecl *BaseDecl = nullptr ;
854
853
Type ExtendedType;
855
854
auto LS = LookupState::makeUnqualified ();
856
855
@@ -874,7 +873,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
874
873
if (auto *SE = dyn_cast<SubscriptDecl>(DC)) {
875
874
ExtendedType = SE->getDeclContext ()->getSelfTypeInContext ();
876
875
DC = DC->getParent ();
877
- BaseDecl = DC->getSelfNominalTypeDecl ();
878
876
} else if (auto *AFD = dyn_cast<AbstractFunctionDecl>(DC)) {
879
877
880
878
// Look for local variables; normally, the parser resolves these
@@ -897,7 +895,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
897
895
898
896
if (AFD->getDeclContext ()->isTypeContext ()) {
899
897
ExtendedType = AFD->getDeclContext ()->getSelfTypeInContext ();
900
- BaseDecl = AFD->getImplicitSelfDecl ();
901
898
DC = DC->getParent ();
902
899
903
900
if (auto *FD = dyn_cast<FuncDecl>(AFD))
@@ -913,11 +910,8 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
913
910
}
914
911
} else if (auto ED = dyn_cast<ExtensionDecl>(DC)) {
915
912
ExtendedType = ED->getSelfTypeInContext ();
916
- if (ExtendedType)
917
- BaseDecl = ExtendedType->getNominalOrBoundGenericNominal ();
918
913
} else if (auto ND = dyn_cast<NominalTypeDecl>(DC)) {
919
914
ExtendedType = ND->getSelfTypeInContext ();
920
- BaseDecl = ND;
921
915
}
922
916
923
917
// If we're inside a function context, we've already moved to
@@ -943,7 +937,7 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
943
937
dcGenericParams = dcGenericParams->getOuterParameters ();
944
938
}
945
939
946
- if (BaseDecl && ExtendedType)
940
+ if (ExtendedType)
947
941
::lookupVisibleMemberDecls (ExtendedType, Consumer, DC, LS, Reason,
948
942
TypeResolver, nullptr );
949
943
0 commit comments