@@ -2007,11 +2007,12 @@ bool ConstraintSystem::solveForDisjunctionChoices(
2007
2007
Optional<Score> bestNonGenericScore;
2008
2008
2009
2009
++solverState->NumDisjunctions ;
2010
+ bool explicitConversion = isExplicitConversionConstraint (disjunction);
2010
2011
auto constraints = disjunction->getNestedConstraints ();
2011
2012
// Try each of the constraints within the disjunction.
2012
2013
for (auto index : indices (constraints)) {
2013
2014
auto currentChoice =
2014
- DisjunctionChoice (this , disjunction, constraints[index]);
2015
+ DisjunctionChoice (this , constraints[index], explicitConversion );
2015
2016
if (shouldSkipDisjunctionChoice (*this , currentChoice, bestNonGenericScore))
2016
2017
continue ;
2017
2018
@@ -2159,7 +2160,9 @@ DisjunctionChoice::solve(SmallVectorImpl<Solution> &solutions,
2159
2160
FreeTypeVariableBinding allowFreeTypeVariables) {
2160
2161
CS->simplifyDisjunctionChoice (Choice);
2161
2162
2162
- propagateConversionInfo ();
2163
+ if (ExplicitConversion)
2164
+ propagateConversionInfo ();
2165
+
2163
2166
if (CS->solveRec (solutions, allowFreeTypeVariables))
2164
2167
return None;
2165
2168
@@ -2204,8 +2207,7 @@ bool DisjunctionChoice::isSymmetricOperator() const {
2204
2207
}
2205
2208
2206
2209
void DisjunctionChoice::propagateConversionInfo () const {
2207
- if (!CS->isExplicitConversionConstraint (Disjunction))
2208
- return ;
2210
+ assert (ExplicitConversion);
2209
2211
2210
2212
auto LHS = Choice->getFirstType ();
2211
2213
auto typeVar = LHS->getAs <TypeVariableType>();
0 commit comments