@@ -171,7 +171,6 @@ class UnqualifiedLookupFactory {
171
171
};
172
172
173
173
struct PerDeclInfo {
174
- bool isDoneWithThisDecl;
175
174
DeclContext *lookupContextForThisDecl;
176
175
Optional<PlacesToSearch> placesToSearch;
177
176
Optional<bool > isCascadingUse;
@@ -692,17 +691,13 @@ UnqualifiedLookupFactory::lookupInOneDeclContext(
692
691
const auto r = lookupInAppropriateContext (dc, isCascadingUseArg);
693
692
if (!r.hasValue ())
694
693
return None;
695
- const bool isDoneWithThisDecl = r.getValue ().isDoneWithThisDecl ;
696
694
breadcrumbs.push_back (r.getValue ());
697
695
auto lookupContextForThisDecl = r.getValue ().lookupContextForThisDecl ;
698
696
auto placesToSearch = std::move (r.getValue ().placesToSearch );
699
697
auto isCascadingUse = r.getValue ().isCascadingUse ;
700
698
701
- if (isDoneWithThisDecl)
702
- return LookupInOneDeclContextResult{lookupContextForThisDecl,
703
- isCascadingUse};
704
-
705
- if (addGenericParametersHereAndInEnclosingScopes (lookupContextForThisDecl))
699
+ if (!dyn_cast<DefaultArgumentInitializer>(dc) &&
700
+ addGenericParametersHereAndInEnclosingScopes (lookupContextForThisDecl))
706
701
return None;
707
702
if (placesToSearch.hasValue () && !placesToSearch.getValue ().empty ()) {
708
703
auto startIndexOfInnerResults = Results.size ();
@@ -752,7 +747,6 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
752
747
DeclContext *const parent = PBI->getParent ();
753
748
// clang-format off
754
749
return PerDeclInfo{
755
- false ,
756
750
parent,
757
751
PlacesToSearch (PBI, parent, parent),
758
752
resolveIsCascadingUse (PBI, isCascadingUse,
@@ -765,7 +759,6 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
765
759
DeclContext *const surroundingContext = PBI->getParent ();
766
760
// clang-format off
767
761
return PerDeclInfo{
768
- false ,
769
762
surroundingContext,
770
763
PlacesToSearch (surroundingContext,
771
764
surroundingContext, surroundingContext),
@@ -779,7 +772,6 @@ UnqualifiedLookupFactory::lookupInPatternBindingInitializer(
779
772
// context.
780
773
// clang-format off
781
774
return PerDeclInfo{
782
- false ,
783
775
PBI,
784
776
None,
785
777
resolveIsCascadingUse (PBI, isCascadingUse,
@@ -827,7 +819,6 @@ UnqualifiedLookupFactory::lookupInFunctionDecl(AbstractFunctionDecl *AFD,
827
819
if (!AFD->getDeclContext ()->isTypeContext ())
828
820
// clang-format off
829
821
return PerDeclInfo{
830
- false ,
831
822
AFD,
832
823
None,
833
824
returnValueForIsCascadingUse};
@@ -841,7 +832,6 @@ UnqualifiedLookupFactory::lookupInFunctionDecl(AbstractFunctionDecl *AFD,
841
832
DeclContext *const BaseDC = isOutsideBodyOfFunction (AFD) ? fnDeclContext : AFD;
842
833
// clang-format off
843
834
return PerDeclInfo{
844
- false ,
845
835
AFD->getParent (),
846
836
PlacesToSearch (BaseDC,
847
837
fnDeclContext,
@@ -872,7 +862,6 @@ UnqualifiedLookupFactory::lookupInClosure(AbstractClosureExpr *ACE,
872
862
}
873
863
// clang-format off
874
864
return PerDeclInfo{
875
- false ,
876
865
ACE,
877
866
None,
878
867
resolveIsCascadingUse (ACE, isCascadingUse,
@@ -886,7 +875,6 @@ UnqualifiedLookupFactory::lookupInNominalTypeOrExtension(
886
875
NominalTypeDeclOrExtensionDecl *D, Optional<bool > isCascadingUse) const {
887
876
// clang-format off
888
877
return PerDeclInfo{
889
- false ,
890
878
D,
891
879
shouldLookupMembers (D, Loc)
892
880
? Optional<PlacesToSearch>(PlacesToSearch (D, D, D))
@@ -904,7 +892,6 @@ UnqualifiedLookupFactory::lookupInDefaultArgumentInitializer(
904
892
// initializer and the function.
905
893
// clang-format off
906
894
return PerDeclInfo{
907
- true ,
908
895
I->getParent (),
909
896
None,
910
897
false };
@@ -927,7 +914,6 @@ UnqualifiedLookupFactory::lookupInMiscContext(
927
914
isa<TypeAliasDecl>(dc) ||
928
915
isa<SubscriptDecl>(dc));
929
916
return PerDeclInfo{
930
- false ,
931
917
dc,
932
918
None,
933
919
resolveIsCascadingUse (DC, isCascadingUse,
@@ -1757,7 +1743,6 @@ void UnqualifiedLookupFactory::dumpBreadcrumbs() const {
1757
1743
1758
1744
void UnqualifiedLookupFactory::PerDeclInfo::dump () const {
1759
1745
auto &e = llvm::errs ();
1760
- e << (isDoneWithThisDecl ? " done: " : " not done: " );
1761
1746
e << " dc: " ;
1762
1747
lookupContextForThisDecl->dumpContext ();
1763
1748
if (placesToSearch.hasValue ())
0 commit comments