@@ -1189,8 +1189,8 @@ namespace {
1189
1189
calleeFnTy = calleeFnTy->getResult()->castTo<FunctionType>();
1190
1190
}
1191
1191
1192
- const auto & appliedPropertyWrappers =
1193
- solution.appliedPropertyWrappers[ locator.getAnchor()] ;
1192
+ auto appliedPropertyWrappers =
1193
+ solution.getAppliedPropertyWrappers( locator.getAnchor()) ;
1194
1194
const auto calleeDeclRef = resolveConcreteDeclRef(
1195
1195
dyn_cast<AbstractFunctionDecl>(declOrClosure), locator);
1196
1196
@@ -2334,8 +2334,8 @@ namespace {
2334
2334
->castTo<FunctionType>();
2335
2335
auto fullSubscriptTy = openedFullFnType->getResult()
2336
2336
->castTo<FunctionType>();
2337
- auto & appliedWrappers =
2338
- solution.appliedPropertyWrappers[ memberLoc->getAnchor()] ;
2337
+ auto appliedWrappers =
2338
+ solution.getAppliedPropertyWrappers( memberLoc->getAnchor()) ;
2339
2339
args = coerceCallArguments(
2340
2340
args, fullSubscriptTy, subscriptRef, nullptr,
2341
2341
locator.withPathElement(ConstraintLocator::ApplyArgument),
@@ -6338,6 +6338,7 @@ ArgumentList *ExprRewriter::coerceCallArguments(
6338
6338
auto *paramDecl = getParameterAt(callee, paramIdx);
6339
6339
assert(paramDecl);
6340
6340
6341
+ ASSERT(appliedWrapperIndex < appliedPropertyWrappers.size());
6341
6342
auto appliedWrapper = appliedPropertyWrappers[appliedWrapperIndex++];
6342
6343
auto wrapperType = solution.simplifyType(appliedWrapper.wrapperType);
6343
6344
auto initKind = appliedWrapper.initKind;
@@ -8240,7 +8241,8 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
8240
8241
// Resolve into a DynamicTypeExpr.
8241
8242
auto args = apply->getArgs();
8242
8243
8243
- auto &appliedWrappers = solution.appliedPropertyWrappers[calleeLocator.getAnchor()];
8244
+ auto appliedWrappers = solution.getAppliedPropertyWrappers(
8245
+ calleeLocator.getAnchor());
8244
8246
auto fnType = cs.getType(fn)->getAs<FunctionType>();
8245
8247
args = coerceCallArguments(
8246
8248
args, fnType, declRef, apply,
@@ -8436,7 +8438,9 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
8436
8438
// For function application, convert the argument to the input type of
8437
8439
// the function.
8438
8440
if (auto fnType = cs.getType(fn)->getAs<FunctionType>()) {
8439
- auto &appliedWrappers = solution.appliedPropertyWrappers[calleeLocator.getAnchor()];
8441
+ auto appliedWrappers = solution.getAppliedPropertyWrappers(
8442
+ calleeLocator.getAnchor());
8443
+
8440
8444
args = coerceCallArguments(
8441
8445
args, fnType, callee, apply,
8442
8446
locator.withPathElement(ConstraintLocator::ApplyArgument),
0 commit comments