Skip to content

Commit 4fd9a44

Browse files
committed
[Sema]Use coerceCallArguments to make sure that AST is updated correctly and call gets LoadExpr
1 parent ebca3f8 commit 4fd9a44

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/Sema/CSApply.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8217,7 +8217,18 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
82178217
// Resolve into a MakeTemporarilyEscapableExpr.
82188218
auto *args = apply->getArgs();
82198219
assert(args->size() == 2 && "should have two arguments");
8220-
auto *nonescaping = cs.coerceToRValue(args->getExpr(0));
8220+
8221+
auto appliedWrappers =
8222+
solution.getAppliedPropertyWrappers(calleeLocator.getAnchor());
8223+
auto fnType = cs.getType(fn)->getAs<FunctionType>();
8224+
args = coerceCallArguments(
8225+
args, fnType, declRef, apply,
8226+
locator.withPathElement(ConstraintLocator::ApplyArgument),
8227+
appliedWrappers);
8228+
if (!args)
8229+
return nullptr;
8230+
8231+
auto *nonescaping = args->getExpr(0);
82218232
auto *body = args->getExpr(1);
82228233
auto bodyTy = cs.getType(body)->getWithoutSpecifierType();
82238234
auto bodyFnTy = bodyTy->castTo<FunctionType>();

0 commit comments

Comments
 (0)