Skip to content

Commit 08aa31d

Browse files
committed
[Constraint solver] Slightly expand the "contextual conversion failure" check.
Expand the context conversion failure check used to fix rdar://28909024 to cover the case where we have a single-argument mismatch and there is a type parameter deduction as well.
1 parent f786a9a commit 08aa31d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5436,7 +5436,9 @@ bool FailureDiagnosis::visitApplyExpr(ApplyExpr *callExpr) {
54365436
if (calleeInfo.closeness == CC_ExactMatch)
54375437
return true;
54385438

5439-
if (!CS->getContextualType() || calleeInfo.closeness != CC_ArgumentMismatch)
5439+
if (!CS->getContextualType() ||
5440+
(calleeInfo.closeness != CC_ArgumentMismatch &&
5441+
calleeInfo.closeness != CC_OneGenericArgumentMismatch))
54405442
return false;
54415443

54425444
CalleeCandidateInfo candidates(fnExpr, hasTrailingClosure, CS);

0 commit comments

Comments
 (0)