@@ -180,7 +180,7 @@ class ScopeCreator final : public ASTAllocated<ScopeCreator> {
180
180
addChildrenForParsedAccessors (AbstractStorageDecl *asd,
181
181
ASTScopeImpl *parent);
182
182
183
- void addChildrenForKnownAttributes (ValueDecl *decl,
183
+ void addChildrenForKnownAttributes (Decl *decl,
184
184
ASTScopeImpl *parent);
185
185
186
186
// / Add PatternEntryDeclScopes for each pattern binding entry.
@@ -569,7 +569,7 @@ void ScopeCreator::addChildrenForParsedAccessors(
569
569
});
570
570
}
571
571
572
- void ScopeCreator::addChildrenForKnownAttributes (ValueDecl *decl,
572
+ void ScopeCreator::addChildrenForKnownAttributes (Decl *decl,
573
573
ASTScopeImpl *parent) {
574
574
SmallVector<DeclAttribute *, 2 > relevantAttrs;
575
575
@@ -601,10 +601,8 @@ void ScopeCreator::addChildrenForKnownAttributes(ValueDecl *decl,
601
601
parent, specAttr, afd);
602
602
}
603
603
} else if (auto *customAttr = dyn_cast<CustomAttr>(attr)) {
604
- if (auto *vd = dyn_cast<VarDecl>(decl)) {
605
- constructExpandAndInsert<CustomAttributeScope>(
606
- parent, customAttr, vd);
607
- }
604
+ constructExpandAndInsert<CustomAttributeScope>(
605
+ parent, customAttr, decl);
608
606
}
609
607
}
610
608
}
@@ -1192,7 +1190,9 @@ ASTScopeImpl *GenericTypeOrExtensionWholePortion::expandScope(
1192
1190
GenericTypeOrExtensionScope *scope, ScopeCreator &scopeCreator) const {
1193
1191
// Get now in case recursion emancipates scope
1194
1192
auto *const ip = scope->getParent ().get ();
1195
-
1193
+
1194
+ scopeCreator.addChildrenForKnownAttributes (scope->getDecl (), scope);
1195
+
1196
1196
auto *context = scope->getGenericContext ();
1197
1197
auto *genericParams = (isa<TypeAliasDecl>(context)
1198
1198
? context->getParsedGenericParams ()
0 commit comments