Fix RawRepresentable fix-its for single unlabeled arguments

They were being put outside the call parentheses instead of inside.
We even had tests for this; I just got them wrong.

https://bugs.swift.org/browse/SR-8150
This commit is contained in:
Jordan Rose
2018-07-03 11:12:08 -07:00
parent 84f17e1611
commit cc82ae00d9
2 changed files with 4 additions and 3 deletions

View File

@@ -4575,9 +4575,10 @@ static bool diagnoseRawRepresentableMismatch(CalleeCandidateInfo &CCI,
if (!isRawRepresentableMismatch(argType, paramType, kind, CS))
continue;
auto *expr = argExpr;
const Expr *expr = argExpr;
if (tupleArgs)
expr = tupleArgs->getElement(i);
expr = expr->getValueProvidingExpr();
auto diag =
CS.TC.diagnose(expr->getLoc(), diag::cannot_convert_argument_value,