Skip to content

Commit d990f6c

Browse files
committed
[ConstraintSystem] Stop type checking TapExpr elements in shrink()
TapExpr has a 'VarDecl' the type of which is determined by type checking the parent interpolated string literal expression. Type checking TapExpr elements before that always fails, thus a waste of the computing time.
1 parent c17966e commit d990f6c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,12 @@ void ConstraintSystem::shrink(Expr *expr) {
800800
return {false, expr};
801801
}
802802

803+
// Similar to 'ClosureExpr', 'TapExpr' has a 'VarDecl' the type of which
804+
// is determined by type checking the parent interpolated string literal.
805+
if (isa<TapExpr>(expr)) {
806+
return {false, expr};
807+
}
808+
803809
if (auto coerceExpr = dyn_cast<CoerceExpr>(expr)) {
804810
if (coerceExpr->isLiteralInit())
805811
ApplyExprs.push_back({coerceExpr, 1});

0 commit comments

Comments
 (0)