@@ -360,14 +360,13 @@ class ASTScopeImpl {
360
360
return {false , isCascadingUse};
361
361
}
362
362
363
-
364
- virtual bool lookInGenericParameters (Optional<bool > isCascadingUse,
365
- DeclConsumer) const ;
363
+ virtual bool lookInMyGenericParameters (Optional<bool > isCascadingUse,
364
+ DeclConsumer) const ;
366
365
367
366
// Consume the generic parameters in the context and its outer contexts
368
- static bool lookInMyAndOuterGenericParameters ( const GenericContext * ,
369
- Optional<bool > isCascadingUse,
370
- DeclConsumer);
367
+ static bool lookInGenericParametersOf (NullablePtr< const GenericParamList> ,
368
+ Optional<bool > isCascadingUse,
369
+ DeclConsumer);
371
370
372
371
NullablePtr<const ASTScopeImpl> parentIfNotChildOfTopScope () const {
373
372
const auto *p = getParent ().get ();
@@ -579,8 +578,6 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
579
578
virtual std::string declKindName () const = 0;
580
579
virtual bool doesDeclHaveABody () const ;
581
580
const char *portionName () const { return portion->portionName ; }
582
- bool lookInGenericParameters (Optional<bool > isCascadingUse,
583
- DeclConsumer) const override ;
584
581
NullablePtr<DeclContext>
585
582
computeSelfDCForParent (NullablePtr<DeclContext>) const override ;
586
583
Optional<bool > resolveIsCascadingUseForThisScope (
@@ -605,9 +602,18 @@ class GenericTypeOrExtensionScope : public ASTScopeImpl {
605
602
virtual NullablePtr<const ASTScopeImpl> getLookupLimitForDecl () const ;
606
603
};
607
604
608
- class IterableTypeScope : public GenericTypeOrExtensionScope {
605
+ class GenericTypeScope : public GenericTypeOrExtensionScope {
606
+ public:
607
+ GenericTypeScope (const Portion *p) : GenericTypeOrExtensionScope(p) {}
608
+ virtual ~GenericTypeScope () {}
609
+
610
+ bool lookInMyGenericParameters (Optional<bool > isCascadingUse,
611
+ DeclConsumer) const override ;
612
+ };
613
+
614
+ class IterableTypeScope : public GenericTypeScope {
609
615
public:
610
- IterableTypeScope (const Portion *p) : GenericTypeOrExtensionScope (p) {}
616
+ IterableTypeScope (const Portion *p) : GenericTypeScope (p) {}
611
617
virtual ~IterableTypeScope () {}
612
618
613
619
virtual SourceRange getBraces () const = 0;
@@ -659,13 +665,15 @@ class ExtensionScope final : public IterableTypeScope {
659
665
ScopeCreator &) override ;
660
666
void createBodyScope (ASTScopeImpl *leaf, ScopeCreator &) override ;
661
667
NullablePtr<Decl> getDecl () const override { return decl; }
668
+ bool lookInMyGenericParameters (Optional<bool > isCascadingUse,
669
+ DeclConsumer) const override ;
662
670
};
663
671
664
- class TypeAliasScope final : public GenericTypeOrExtensionScope {
672
+ class TypeAliasScope final : public GenericTypeScope {
665
673
public:
666
674
TypeAliasDecl *const decl;
667
675
TypeAliasScope (const Portion *p, TypeAliasDecl *e)
668
- : GenericTypeOrExtensionScope (p), decl(e) {}
676
+ : GenericTypeScope (p), decl(e) {}
669
677
virtual ~TypeAliasScope () {}
670
678
671
679
std::string declKindName () const override { return " TypeAlias" ; }
@@ -675,11 +683,11 @@ class TypeAliasScope final : public GenericTypeOrExtensionScope {
675
683
NullablePtr<Decl> getDecl () const override { return decl; }
676
684
};
677
685
678
- class OpaqueTypeScope final : public GenericTypeOrExtensionScope {
686
+ class OpaqueTypeScope final : public GenericTypeScope {
679
687
public:
680
688
OpaqueTypeDecl *const decl;
681
689
OpaqueTypeScope (const Portion *p, OpaqueTypeDecl *e)
682
- : GenericTypeOrExtensionScope (p), decl(e) {}
690
+ : GenericTypeScope (p), decl(e) {}
683
691
virtual ~OpaqueTypeScope () {}
684
692
685
693
std::string declKindName () const override { return " OpaqueType" ; }
@@ -764,8 +772,8 @@ class AbstractFunctionDeclScope final : public ASTScopeImpl {
764
772
765
773
protected:
766
774
Decl *getEnclosingAbstractFunctionOrSubscriptDecl () const override ;
767
- bool lookInGenericParameters (Optional<bool > isCascadingUse,
768
- DeclConsumer) const override ;
775
+ bool lookInMyGenericParameters (Optional<bool > isCascadingUse,
776
+ DeclConsumer) const override ;
769
777
Optional<bool >
770
778
resolveIsCascadingUseForThisScope (Optional<bool >) const override ;
771
779
};
@@ -1246,8 +1254,8 @@ class SubscriptDeclScope final : public ASTScopeImpl {
1246
1254
1247
1255
protected:
1248
1256
Decl *getEnclosingAbstractFunctionOrSubscriptDecl () const override ;
1249
- bool lookInGenericParameters (Optional<bool > isCascadingUse,
1250
- DeclConsumer) const override ;
1257
+ bool lookInMyGenericParameters (Optional<bool > isCascadingUse,
1258
+ DeclConsumer) const override ;
1251
1259
NullablePtr<AbstractStorageDecl>
1252
1260
getEnclosingAbstractStorageDecl () const override {
1253
1261
return decl;
0 commit comments