Skip to content

Commit aefaa14

Browse files
authored
Merge pull request #28047 from LucianoPAlmeida/removing-non-opnional-csdiag-code
2 parents 5076d71 + 43a3ca4 commit aefaa14

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

lib/Sema/CSDiag.cpp

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

294-
bool visitForceValueExpr(ForceValueExpr *FVE);
295294
bool visitBindOptionalExpr(BindOptionalExpr *BOE);
296295

297296
bool visitSubscriptExpr(SubscriptExpr *SE);
@@ -3321,24 +3320,6 @@ bool FailureDiagnosis::visitCoerceExpr(CoerceExpr *CE) {
33213320
return false;
33223321
}
33233322

3324-
bool FailureDiagnosis::visitForceValueExpr(ForceValueExpr *FVE) {
3325-
auto argExpr = typeCheckChildIndependently(FVE->getSubExpr());
3326-
if (!argExpr) return true;
3327-
auto argType = CS.getType(argExpr);
3328-
3329-
// If the subexpression type checks as a non-optional type, then that is the
3330-
// error. Produce a specific diagnostic about this.
3331-
if (!isUnresolvedOrTypeVarType(argType) &&
3332-
argType->getOptionalObjectType().isNull()) {
3333-
diagnose(FVE->getLoc(), diag::invalid_force_unwrap, argType)
3334-
.fixItRemove(FVE->getExclaimLoc())
3335-
.highlight(FVE->getSourceRange());
3336-
return true;
3337-
}
3338-
3339-
return false;
3340-
}
3341-
33423323
bool FailureDiagnosis::visitBindOptionalExpr(BindOptionalExpr *BOE) {
33433324
auto argExpr = typeCheckChildIndependently(BOE->getSubExpr());
33443325
if (!argExpr) return true;

0 commit comments

Comments
 (0)