File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1080,9 +1080,12 @@ void TypeChecker::checkIgnoredExpr(Expr *E) {
1080
1080
// If we have an OptionalEvaluationExpr at the top level, then someone is
1081
1081
// "optional chaining" and ignoring the result. Produce a diagnostic if it
1082
1082
// doesn't make sense to ignore it.
1083
- if (auto *OEE = dyn_cast<OptionalEvaluationExpr>(valueE))
1083
+ if (auto *OEE = dyn_cast<OptionalEvaluationExpr>(valueE)) {
1084
1084
if (auto *IIO = dyn_cast<InjectIntoOptionalExpr>(OEE->getSubExpr ()))
1085
1085
return checkIgnoredExpr (IIO->getSubExpr ());
1086
+ if (auto *C = dyn_cast<CallExpr>(OEE->getSubExpr ()))
1087
+ return checkIgnoredExpr (C);
1088
+ }
1086
1089
1087
1090
// Check if we have a call to a function not marked with
1088
1091
// '@discardableResult'.
You can’t perform that action at this time.
0 commit comments