Skip to content

Commit 03a9caa

Browse files
committed
[CSBindings] Make sure that transitive bindings aren't inferred on itself
It's possible to find current type variable while trying to infer transitive bindings (because sources are gathered from multiple different type variables and current type variable could be a representative of an equivalence class), let's make sure we don't attempt to use constraints which refer to current type variable on the left-hand side. Resolves: rdar://problem/65724310
1 parent a907a15 commit 03a9caa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void ConstraintSystem::PotentialBindings::inferTransitiveBindings(
4747
for (auto *constraint : conversions) {
4848
auto *tv =
4949
cs.simplifyType(constraint->getFirstType())->getAs<TypeVariableType>();
50-
if (!tv)
50+
if (!tv || tv == TypeVar)
5151
continue;
5252

5353
auto relatedBindings = inferredBindings.find(tv);

0 commit comments

Comments
 (0)