diff --git a/lib/Sema/CSDiag.cpp b/lib/Sema/CSDiag.cpp index d66a82630c88c..7ec416c2a0a52 100644 --- a/lib/Sema/CSDiag.cpp +++ b/lib/Sema/CSDiag.cpp @@ -221,7 +221,6 @@ class FailureDiagnosis :public ASTVisitor{ validateContextualType(Type contextualType, ContextualTypePurpose CTP); bool visitExpr(Expr *E); - bool visitIdentityExpr(IdentityExpr *E); bool visitTryExpr(TryExpr *E); bool visitApplyExpr(ApplyExpr *AE); @@ -1582,21 +1581,6 @@ visitRebindSelfInConstructorExpr(RebindSelfInConstructorExpr *E) { return false; } -/// An IdentityExpr doesn't change its argument, but it *can* propagate its -/// contextual type information down. -bool FailureDiagnosis::visitIdentityExpr(IdentityExpr *E) { - auto contextualType = CS.getContextualType(E); - - // If we have a paren expr and our contextual type is a ParenType, remove the - // paren expr sugar. - if (contextualType) - contextualType = contextualType->getWithoutParens(); - if (!typeCheckChildIndependently(E->getSubExpr(), contextualType, - CS.getContextualTypePurpose(E))) - return true; - return false; -} - /// A TryExpr doesn't change it's argument, nor does it change the contextual /// type. bool FailureDiagnosis::visitTryExpr(TryExpr *E) {