Skip to content

Commit 6dd7bcf

Browse files
committed
[Diagnostics] Remove misplaced LoadExpr workaround for RawRepresentable
Since verifier is now in place to make sure that ParenExpr/ForceValueExpr always preceed LoadExpr there is need to special case against incorrect ordering in diagnostics.
1 parent 5976980 commit 6dd7bcf

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4685,14 +4685,9 @@ static bool diagnoseRawRepresentableMismatch(CalleeCandidateInfo &CCI,
46854685
return false;
46864686

46874687
const Expr *expr = argExpr;
4688-
if (auto *tupleArgs = dyn_cast<TupleExpr>(argExpr)) {
4688+
if (auto *tupleArgs = dyn_cast<TupleExpr>(argExpr))
46894689
expr = tupleArgs->getElement(bestMatchIndex);
4690-
} else if (auto *misplacedLoad = dyn_cast<LoadExpr>(argExpr)) {
4691-
// If there are multiple possible overloads for a single-argument call
4692-
// expression, the partially-typed-checked AST may have a load around the
4693-
// call parentheses instead of inside them.
4694-
expr = misplacedLoad->getSubExpr();
4695-
}
4690+
46964691
expr = expr->getValueProvidingExpr();
46974692

46984693
auto parameters = bestMatchCandidate->getParameters();

0 commit comments

Comments
 (0)