Skip to content

Commit b36dbd5

Browse files
committed
Revert "[ConstraintSystem] Use correct locator when filtering disjunction choices"
This reverts commit 2df4ba7 from #36300 which conflicts with #36267 and was missed because of classic "time of test was too old before merging".
1 parent e82fd4a commit b36dbd5

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9373,7 +9373,7 @@ bool ConstraintSystem::simplifyAppliedOverloads(
93739373
AppliedDisjunctions[disjunction->getLocator()] = argFnType;
93749374
return simplifyAppliedOverloadsImpl(disjunction, fnTypeVar, argFnType,
93759375
/*numOptionalUnwraps*/ result->second,
9376-
applicableFn->getLocator());
9376+
locator);
93779377
}
93789378

93799379
bool ConstraintSystem::simplifyAppliedOverloads(

test/Constraints/overload_filtering.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,3 @@ func testUnresolvedMember(i: Int) -> X {
3838
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:)
3939
return .init(i, i)
4040
}
41-
42-
func test_member_filtering() {
43-
struct S {
44-
// Result types here are different intentionally,
45-
// if there were the same simplication logic would
46-
// trigger and disable overloads during constraint
47-
// generation.
48-
func foo(_: Int) -> S { S() }
49-
func foo(_: String) -> Int { 42 }
50-
51-
func bar(v: String) {}
52-
func bar(_: Int) {}
53-
func bar(a: Double, b: Int) {}
54-
}
55-
56-
func test(s: S) {
57-
// CHECK: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(v:)
58-
// CHECK-NEXT: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(a:b:)
59-
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar
60-
s.foo(42).bar(42)
61-
}
62-
}

0 commit comments

Comments
 (0)