Skip to content

Commit 490548f

Browse files
committed
[Diagnostics] Fix ContextualFailure to use solution data for hasAppliedSelf
1 parent b4c73ab commit 490548f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,8 +2020,7 @@ bool ContextualFailure::diagnoseAsError() {
20202020
}
20212021

20222022
case ConstraintLocator::RValueAdjustment: {
2023-
auto &cs = getConstraintSystem();
2024-
2023+
auto &solution = getSolution();
20252024
auto overload = getOverloadChoiceIfAvailable(
20262025
getConstraintLocator(anchor, ConstraintLocator::UnresolvedMember));
20272026
if (!(overload && overload->choice.isDecl()))
@@ -2047,8 +2046,11 @@ bool ContextualFailure::diagnoseAsError() {
20472046

20482047
auto params = fnType->getParams();
20492048

2050-
ParameterListInfo info(params, choice,
2051-
hasAppliedSelf(cs, overload->choice));
2049+
ParameterListInfo info(
2050+
params, choice,
2051+
hasAppliedSelf(overload->choice, [&solution](Type type) {
2052+
return solution.simplifyType(type);
2053+
}));
20522054
auto numMissingArgs = llvm::count_if(
20532055
indices(params), [&info](const unsigned paramIdx) -> bool {
20542056
return !info.hasDefaultArgument(paramIdx);

0 commit comments

Comments
 (0)