Skip to content

Commit 6a753ac

Browse files
authored
Merge pull request #34619 from xedin/autoclosure-application-loc
[CSApply] Adjust @autoclosure locator to point to argument expression…
2 parents b43eab4 + d675c74 commit 6a753ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/CSApply.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5813,9 +5813,11 @@ Expr *ExprRewriter::coerceCallArguments(
58135813
// - new types are propagated to constraint system
58145814
auto *closureType = param.getPlainType()->castTo<FunctionType>();
58155815

5816+
auto argLoc = getArgLocator(argIdx, paramIdx, param.getParameterFlags());
5817+
58165818
arg = coerceToType(
58175819
arg, closureType->getResult(),
5818-
locator.withPathElement(ConstraintLocator::AutoclosureResult));
5820+
argLoc.withPathElement(ConstraintLocator::AutoclosureResult));
58195821

58205822
if (shouldInjectWrappedValuePlaceholder) {
58215823
// If init(wrappedValue:) takes an autoclosure, then we want

0 commit comments

Comments
 (0)