Skip to content

Commit 64a654d

Browse files
committed
Revert "[CSBindings] Prefer conjunctions over closure variables without bindings"
This reverts commit 11ee82d.
1 parent 3113e83 commit 64a654d

File tree

3 files changed

+0
-116
lines changed

3 files changed

+0
-116
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,13 +1094,6 @@ bool BindingSet::favoredOverConjunction(Constraint *conjunction) const {
10941094
if (locator->directlyAt<ClosureExpr>()) {
10951095
auto *closure = castToExpr<ClosureExpr>(locator->getAnchor());
10961096

1097-
// If there are no bindings for the closure yet we cannot prioritize
1098-
// it because that runs into risk of missing a result builder transform.
1099-
if (TypeVar->getImpl().isClosureType()) {
1100-
if (Bindings.empty())
1101-
return false;
1102-
}
1103-
11041097
if (auto transform = CS.getAppliedResultBuilderTransform(closure)) {
11051098
// Conjunctions that represent closures with result builder transformed
11061099
// bodies could be attempted right after their resolution if they meet

test/Constraints/issue67363.swift

Lines changed: 0 additions & 85 deletions
This file was deleted.

test/expr/closure/multi_statement.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -694,27 +694,3 @@ func test_recursive_var_reference_in_multistatement_closure() {
694694
}
695695
}
696696
}
697-
698-
// https://github.com/apple/swift/issues/67363
699-
func test_result_builder_in_member_chaining() {
700-
@resultBuilder
701-
struct Builder {
702-
static func buildBlock<T>(_: T) -> Int { 42 }
703-
}
704-
705-
struct Test {
706-
static func test<T>(fn: () -> T) -> T {
707-
fn()
708-
}
709-
710-
func builder(@Builder _: () -> Int) {}
711-
}
712-
713-
Test.test {
714-
let test = Test()
715-
return test
716-
}.builder { // Ok
717-
let result = ""
718-
result
719-
}
720-
}

0 commit comments

Comments
 (0)