@@ -845,7 +845,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
845
845
// and if so, whether this is a reference to one of them.
846
846
while (!DC->isModuleScopeContext ()) {
847
847
GenericParamList *GenericParams = nullptr ;
848
- const ValueDecl *BaseDecl = nullptr ;
849
848
Type ExtendedType;
850
849
auto LS = LookupState::makeUnqualified ();
851
850
@@ -869,7 +868,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
869
868
if (auto *SE = dyn_cast<SubscriptDecl>(DC)) {
870
869
ExtendedType = SE->getDeclContext ()->getSelfTypeInContext ();
871
870
DC = DC->getParent ();
872
- BaseDecl = DC->getSelfNominalTypeDecl ();
873
871
} else if (auto *AFD = dyn_cast<AbstractFunctionDecl>(DC)) {
874
872
875
873
// Look for local variables; normally, the parser resolves these
@@ -892,7 +890,6 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
892
890
893
891
if (AFD->getDeclContext ()->isTypeContext ()) {
894
892
ExtendedType = AFD->getDeclContext ()->getSelfTypeInContext ();
895
- BaseDecl = AFD->getImplicitSelfDecl ();
896
893
DC = DC->getParent ();
897
894
898
895
if (auto *FD = dyn_cast<FuncDecl>(AFD))
@@ -908,11 +905,8 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
908
905
}
909
906
} else if (auto ED = dyn_cast<ExtensionDecl>(DC)) {
910
907
ExtendedType = ED->getSelfTypeInContext ();
911
- if (ExtendedType)
912
- BaseDecl = ExtendedType->getNominalOrBoundGenericNominal ();
913
908
} else if (auto ND = dyn_cast<NominalTypeDecl>(DC)) {
914
909
ExtendedType = ND->getSelfTypeInContext ();
915
- BaseDecl = ND;
916
910
}
917
911
918
912
// If we're inside a function context, we've already moved to
@@ -938,7 +932,7 @@ static void lookupVisibleDeclsImpl(VisibleDeclConsumer &Consumer,
938
932
dcGenericParams = dcGenericParams->getOuterParameters ();
939
933
}
940
934
941
- if (BaseDecl && ExtendedType)
935
+ if (ExtendedType)
942
936
::lookupVisibleMemberDecls (ExtendedType, Consumer, DC, LS, Reason,
943
937
TypeResolver, nullptr );
944
938
0 commit comments