@@ -1190,8 +1190,8 @@ namespace {
1190
1190
calleeFnTy = calleeFnTy->getResult ()->castTo <FunctionType>();
1191
1191
}
1192
1192
1193
- const auto & appliedPropertyWrappers =
1194
- solution.appliedPropertyWrappers [ locator.getAnchor ()] ;
1193
+ auto appliedPropertyWrappers =
1194
+ solution.getAppliedPropertyWrappers ( locator.getAnchor ()) ;
1195
1195
const auto calleeDeclRef = resolveConcreteDeclRef (
1196
1196
dyn_cast<AbstractFunctionDecl>(declOrClosure), locator);
1197
1197
@@ -2319,8 +2319,8 @@ namespace {
2319
2319
->castTo <FunctionType>();
2320
2320
auto fullSubscriptTy = openedFullFnType->getResult ()
2321
2321
->castTo <FunctionType>();
2322
- auto & appliedWrappers =
2323
- solution.appliedPropertyWrappers [ memberLoc->getAnchor ()] ;
2322
+ auto appliedWrappers =
2323
+ solution.getAppliedPropertyWrappers ( memberLoc->getAnchor ()) ;
2324
2324
args = coerceCallArguments (
2325
2325
args, fullSubscriptTy, subscriptRef, nullptr ,
2326
2326
locator.withPathElement (ConstraintLocator::ApplyArgument),
@@ -6286,6 +6286,7 @@ ArgumentList *ExprRewriter::coerceCallArguments(
6286
6286
auto *paramDecl = getParameterAt (callee, paramIdx);
6287
6287
assert (paramDecl);
6288
6288
6289
+ ASSERT (appliedWrapperIndex < appliedPropertyWrappers.size ());
6289
6290
auto appliedWrapper = appliedPropertyWrappers[appliedWrapperIndex++];
6290
6291
auto wrapperType = solution.simplifyType (appliedWrapper.wrapperType );
6291
6292
auto initKind = appliedWrapper.initKind ;
@@ -8179,7 +8180,8 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
8179
8180
// Resolve into a DynamicTypeExpr.
8180
8181
auto args = apply->getArgs ();
8181
8182
8182
- auto &appliedWrappers = solution.appliedPropertyWrappers [calleeLocator.getAnchor ()];
8183
+ auto appliedWrappers = solution.getAppliedPropertyWrappers (
8184
+ calleeLocator.getAnchor ());
8183
8185
auto fnType = cs.getType (fn)->getAs <FunctionType>();
8184
8186
args = coerceCallArguments (
8185
8187
args, fnType, declRef, apply,
@@ -8375,7 +8377,9 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
8375
8377
// For function application, convert the argument to the input type of
8376
8378
// the function.
8377
8379
if (auto fnType = cs.getType (fn)->getAs <FunctionType>()) {
8378
- auto &appliedWrappers = solution.appliedPropertyWrappers [calleeLocator.getAnchor ()];
8380
+ auto appliedWrappers = solution.getAppliedPropertyWrappers (
8381
+ calleeLocator.getAnchor ());
8382
+
8379
8383
args = coerceCallArguments (
8380
8384
args, fnType, callee, apply,
8381
8385
locator.withPathElement (ConstraintLocator::ApplyArgument),
0 commit comments