From 76f0bcb05c91a5ec9ef6c011570b12adce5acaea Mon Sep 17 00:00:00 2001 From: Pavel Yaskevich Date: Thu, 10 Oct 2024 23:35:47 +0900 Subject: [PATCH] [CSBindings] Adjust `hasConversions` to handle `Void` has having not conversions Tuples in general do have conversions but an empty tuple or `Void` doesn't, which means that if a type variable has a subtype binding to `Void` it should be safe to prioritize. --- lib/Sema/CSBindings.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Sema/CSBindings.cpp b/lib/Sema/CSBindings.cpp index 2f9a971ab60ec..9631434dc206d 100644 --- a/lib/Sema/CSBindings.cpp +++ b/lib/Sema/CSBindings.cpp @@ -1269,7 +1269,8 @@ static bool hasConversions(Type type) { } return !(type->is() || type->is() || - type->is() || type->is()); + type->is() || type->is() || + type->isVoid()); } bool BindingSet::favoredOverDisjunction(Constraint *disjunction) const {