File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1309,6 +1309,8 @@ class GenericParamList final :
1309
1309
// / for more information.
1310
1310
void setOuterParameters (GenericParamList *Outer) { OuterParameters = Outer; }
1311
1311
1312
+ void setDeclContext (DeclContext *dc);
1313
+
1312
1314
SourceLoc getLAngleLoc () const { return Brackets.Start ; }
1313
1315
SourceLoc getRAngleLoc () const { return Brackets.End ; }
1314
1316
Original file line number Diff line number Diff line change @@ -964,6 +964,11 @@ void GenericParamList::setDepth(unsigned depth) {
964
964
param->setDepth (depth);
965
965
}
966
966
967
+ void GenericParamList::setDeclContext (DeclContext *dc) {
968
+ for (auto param : *this )
969
+ param->setDeclContext (dc);
970
+ }
971
+
967
972
TrailingWhereClause::TrailingWhereClause (
968
973
SourceLoc whereLoc,
969
974
ArrayRef<RequirementRepr> requirements)
Original file line number Diff line number Diff line change @@ -233,10 +233,9 @@ Optional<GenericParamList *> GenericParamListRequest::getCachedResult() const {
233
233
234
234
void GenericParamListRequest::cacheResult (GenericParamList *params) const {
235
235
auto *context = std::get<0 >(getStorage ());
236
- if (params) {
237
- for (auto param : *params)
238
- param->setDeclContext (context);
239
- }
236
+ if (params)
237
+ params->setDeclContext (context);
238
+
240
239
context->GenericParamsAndBit .setPointerAndInt (params, true );
241
240
}
242
241
You can’t perform that action at this time.
0 commit comments