Skip to content

Commit 377fd98

Browse files
committed
[CSApply] Use ConcreteDeclRef for getParameterAt when possible
This is important if overload is variadic generic, in such cases substitution map is used to determine actual parameter index.
1 parent 316dfaf commit 377fd98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/CSApply.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5490,7 +5490,7 @@ Solution::resolveLocatorToDecl(ConstraintLocator *locator) const {
54905490
/// index. This looks through inheritance for inherited default args.
54915491
static ConcreteDeclRef getDefaultArgOwner(ConcreteDeclRef owner,
54925492
unsigned index) {
5493-
auto *param = getParameterAt(owner.getDecl(), index);
5493+
auto *param = getParameterAt(owner, index);
54945494
assert(param);
54955495
if (param->getDefaultArgumentKind() == DefaultArgumentKind::Inherited) {
54965496
return getDefaultArgOwner(owner.getOverriddenDecl(), index);
@@ -6027,7 +6027,7 @@ ArgumentList *ExprRewriter::coerceCallArguments(
60276027
};
60286028

60296029
if (paramInfo.hasExternalPropertyWrapper(paramIdx)) {
6030-
auto *paramDecl = getParameterAt(callee.getDecl(), paramIdx);
6030+
auto *paramDecl = getParameterAt(callee, paramIdx);
60316031
assert(paramDecl);
60326032

60336033
auto appliedWrapper = appliedPropertyWrappers[appliedWrapperIndex++];

0 commit comments

Comments
 (0)