File tree Expand file tree Collapse file tree 1 file changed +8
-23
lines changed Expand file tree Collapse file tree 1 file changed +8
-23
lines changed Original file line number Diff line number Diff line change @@ -8151,6 +8151,11 @@ namespace {
8151
8151
// with already-type-checked expressions. Don't walk into them.
8152
8152
return false ;
8153
8153
}
8154
+
8155
+ // / Check if there are any closures or tap expressions left to process.
8156
+ bool shouldPrintFullyChecked () {
8157
+ return ClosuresToTypeCheck.empty () && TapsToTypeCheck.empty ();
8158
+ }
8154
8159
8155
8160
// / Process delayed closure bodies and `Tap` expressions.
8156
8161
// /
@@ -9079,36 +9084,16 @@ Optional<SolutionApplicationTarget> ConstraintSystem::applySolution(
9079
9084
if (hadError)
9080
9085
return None;
9081
9086
9082
- bool isPartial = false ;
9083
- resultTarget->getAsExpr ()->forEachChildExpr ([&](Expr *child) -> Expr * {
9084
- if (auto *closure = dyn_cast<ClosureExpr>(child)) {
9085
- if (!closure->hasSingleExpressionBody ()) {
9086
- isPartial = true ;
9087
- return nullptr ;
9088
- }
9089
- }
9090
- if (isa<TapExpr>(child)) {
9091
- isPartial = true ;
9092
- return nullptr ;
9093
- }
9094
- return child;
9095
- });
9096
-
9097
- if (isPartial) {
9087
+ // If there are no more closures or tap expressions to check,
9088
+ // print expression.
9089
+ if (walker.shouldPrintFullyChecked ()) {
9098
9090
auto &log = llvm::errs ();
9099
9091
log << " ---Fully type-checked expression---\n " ;
9100
9092
resultTarget->getAsExpr ()->dump (log);
9101
9093
log << " \n " ;
9102
9094
}
9103
9095
9104
9096
rewriter.finalize ();
9105
-
9106
- // if (isDebugMode()) {
9107
- // auto &log = llvm::errs();
9108
- // log << "---Fully type-checked expression---\n";
9109
- // resultTarget->getAsExpr()->dump(log);
9110
- // log << "\n";
9111
- // }
9112
9097
9113
9098
return resultTarget;
9114
9099
}
You can’t perform that action at this time.
0 commit comments