Skip to content

Commit fdd67a6

Browse files
committed
[Sema] NFC: Remove obsolete isInResultBuilderContext method
Type-checking of result builder transformed closure is enabled by default now, so this method is no longer used.
1 parent bc28171 commit fdd67a6

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5497,10 +5497,6 @@ class ConstraintSystem {
54975497
/// part of the constraint system.
54985498
void forEachExpr(Expr *expr, llvm::function_ref<Expr *(Expr *)> callback);
54995499

5500-
/// Determine whether one of the parent closures the given one is nested
5501-
/// in (if any) has a result builder applied to its body.
5502-
bool isInResultBuilderContext(ClosureExpr *closure) const;
5503-
55045500
/// Determine whether referencing the given member on the
55055501
/// given existential base type is supported. This is the case only if the
55065502
/// type of the member, spelled in the context of \p baseTy, does not contain

lib/Sema/CSSyntacticElement.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,25 +1539,6 @@ void ConstraintSystem::generateConstraints(ArrayRef<ExprPattern *> exprPatterns,
15391539
referencedTypeVars);
15401540
}
15411541

1542-
bool ConstraintSystem::isInResultBuilderContext(ClosureExpr *closure) const {
1543-
if (!closure->hasSingleExpressionBody()) {
1544-
auto *DC = closure->getParent();
1545-
do {
1546-
// Result builder is applied to a function/getter body.
1547-
if (auto *AFD = dyn_cast<AbstractFunctionDecl>(DC)) {
1548-
if (resultBuilderTransformed.count(AFD))
1549-
return true;
1550-
}
1551-
1552-
if (auto *parentClosure = dyn_cast<ClosureExpr>(DC)) {
1553-
if (resultBuilderTransformed.count(parentClosure))
1554-
return true;
1555-
}
1556-
} while ((DC = DC->getParent()));
1557-
}
1558-
return false;
1559-
}
1560-
15611542
bool isConditionOfStmt(ConstraintLocatorBuilder locator) {
15621543
if (!locator.endsWith<LocatorPathElt::Condition>())
15631544
return false;

0 commit comments

Comments
 (0)