@@ -291,8 +291,6 @@ class FailureDiagnosis :public ASTVisitor<FailureDiagnosis, /*exprresult*/bool>{
291
291
bool visitDictionaryExpr (DictionaryExpr *E);
292
292
bool visitObjectLiteralExpr (ObjectLiteralExpr *E);
293
293
294
- bool visitBindOptionalExpr (BindOptionalExpr *BOE);
295
-
296
294
bool visitSubscriptExpr (SubscriptExpr *SE);
297
295
bool visitApplyExpr (ApplyExpr *AE);
298
296
bool visitAssignExpr (AssignExpr *AE);
@@ -3320,24 +3318,6 @@ bool FailureDiagnosis::visitCoerceExpr(CoerceExpr *CE) {
3320
3318
return false ;
3321
3319
}
3322
3320
3323
- bool FailureDiagnosis::visitBindOptionalExpr (BindOptionalExpr *BOE) {
3324
- auto argExpr = typeCheckChildIndependently (BOE->getSubExpr ());
3325
- if (!argExpr) return true ;
3326
- auto argType = CS.getType (argExpr);
3327
-
3328
- // If the subexpression type checks as a non-optional type, then that is the
3329
- // error. Produce a specific diagnostic about this.
3330
- if (!isUnresolvedOrTypeVarType (argType) &&
3331
- argType->getOptionalObjectType ().isNull ()) {
3332
- diagnose (BOE->getQuestionLoc (), diag::invalid_optional_chain, argType)
3333
- .highlight (BOE->getSourceRange ())
3334
- .fixItRemove (BOE->getQuestionLoc ());
3335
- return true ;
3336
- }
3337
-
3338
- return false ;
3339
- }
3340
-
3341
3321
bool FailureDiagnosis::visitIfExpr (IfExpr *IE) {
3342
3322
auto typeCheckClauseExpr = [&](Expr *clause, Type contextType = Type (),
3343
3323
ContextualTypePurpose convertPurpose =
0 commit comments