Skip to content

Commit 1c0bdc8

Browse files
authored
Merge pull request #29413 from LucianoPAlmeida/remove-visit-identity-expr-csdiag
[Diagnostics] Remove obsolete FailureDiagnosis::visitIdentityExpr from CSDiag
2 parents af847c2 + 2c7cc7b commit 1c0bdc8

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ class FailureDiagnosis :public ASTVisitor<FailureDiagnosis, /*exprresult*/bool>{
221221
validateContextualType(Type contextualType, ContextualTypePurpose CTP);
222222

223223
bool visitExpr(Expr *E);
224-
bool visitIdentityExpr(IdentityExpr *E);
225224
bool visitTryExpr(TryExpr *E);
226225

227226
bool visitApplyExpr(ApplyExpr *AE);
@@ -1524,21 +1523,6 @@ visitRebindSelfInConstructorExpr(RebindSelfInConstructorExpr *E) {
15241523
return false;
15251524
}
15261525

1527-
/// An IdentityExpr doesn't change its argument, but it *can* propagate its
1528-
/// contextual type information down.
1529-
bool FailureDiagnosis::visitIdentityExpr(IdentityExpr *E) {
1530-
auto contextualType = CS.getContextualType(E);
1531-
1532-
// If we have a paren expr and our contextual type is a ParenType, remove the
1533-
// paren expr sugar.
1534-
if (contextualType)
1535-
contextualType = contextualType->getWithoutParens();
1536-
if (!typeCheckChildIndependently(E->getSubExpr(), contextualType,
1537-
CS.getContextualTypePurpose(E)))
1538-
return true;
1539-
return false;
1540-
}
1541-
15421526
/// A TryExpr doesn't change it's argument, nor does it change the contextual
15431527
/// type.
15441528
bool FailureDiagnosis::visitTryExpr(TryExpr *E) {

0 commit comments

Comments
 (0)