Skip to content

Commit 020c29b

Browse files
hborlaxedin
authored andcommitted
[CSBindings] Don't attempt to bind type variables early if the conversion
type is CGFloat or Double, and minimize the diagnostic impact of this heuristic by only binding early for valid code.
1 parent 4799acf commit 020c29b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,10 @@ bool BindingSet::favoredOverDisjunction(Constraint *disjunction) const {
990990

991991
auto type = binding.BindingType;
992992

993-
if (type->isAnyHashable())
993+
if (CS.shouldAttemptFixes())
994+
return false;
995+
996+
if (type->isAnyHashable() || type->isDouble() || type->isCGFloatType())
994997
return false;
995998

996999
{

0 commit comments

Comments
 (0)