Skip to content

Commit 095bb5b

Browse files
[CSDiag] Removing invalid_optional_chain diagnostic from CSDiag
1 parent aefaa14 commit 095bb5b

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ class FailureDiagnosis :public ASTVisitor<FailureDiagnosis, /*exprresult*/bool>{
291291
bool visitDictionaryExpr(DictionaryExpr *E);
292292
bool visitObjectLiteralExpr(ObjectLiteralExpr *E);
293293

294-
bool visitBindOptionalExpr(BindOptionalExpr *BOE);
295-
296294
bool visitSubscriptExpr(SubscriptExpr *SE);
297295
bool visitApplyExpr(ApplyExpr *AE);
298296
bool visitAssignExpr(AssignExpr *AE);
@@ -3320,24 +3318,6 @@ bool FailureDiagnosis::visitCoerceExpr(CoerceExpr *CE) {
33203318
return false;
33213319
}
33223320

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-
33413321
bool FailureDiagnosis::visitIfExpr(IfExpr *IE) {
33423322
auto typeCheckClauseExpr = [&](Expr *clause, Type contextType = Type(),
33433323
ContextualTypePurpose convertPurpose =

0 commit comments

Comments
 (0)