Skip to content

Commit 76f0bcb

Browse files
committed
[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.
1 parent cdd8fe9 commit 76f0bcb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,8 @@ static bool hasConversions(Type type) {
12691269
}
12701270

12711271
return !(type->is<StructType>() || type->is<EnumType>() ||
1272-
type->is<BuiltinType>() || type->is<ArchetypeType>());
1272+
type->is<BuiltinType>() || type->is<ArchetypeType>() ||
1273+
type->isVoid());
12731274
}
12741275

12751276
bool BindingSet::favoredOverDisjunction(Constraint *disjunction) const {

0 commit comments

Comments
 (0)