@@ -2012,11 +2012,12 @@ bool ConstraintSystem::solveForDisjunctionChoices(
2012
2012
Optional<Score> bestNonGenericScore;
2013
2013
2014
2014
++solverState->NumDisjunctions ;
2015
+ bool explicitConversion = isExplicitConversionConstraint (disjunction);
2015
2016
auto constraints = disjunction->getNestedConstraints ();
2016
2017
// Try each of the constraints within the disjunction.
2017
2018
for (auto index : indices (constraints)) {
2018
2019
auto currentChoice =
2019
- DisjunctionChoice (this , disjunction, constraints[index]);
2020
+ DisjunctionChoice (this , constraints[index], explicitConversion );
2020
2021
if (shouldSkipDisjunctionChoice (*this , currentChoice, bestNonGenericScore))
2021
2022
continue ;
2022
2023
@@ -2164,7 +2165,9 @@ DisjunctionChoice::solve(SmallVectorImpl<Solution> &solutions,
2164
2165
FreeTypeVariableBinding allowFreeTypeVariables) {
2165
2166
CS->simplifyDisjunctionChoice (Choice);
2166
2167
2167
- propagateConversionInfo ();
2168
+ if (ExplicitConversion)
2169
+ propagateConversionInfo ();
2170
+
2168
2171
if (CS->solveRec (solutions, allowFreeTypeVariables))
2169
2172
return None;
2170
2173
@@ -2209,8 +2212,7 @@ bool DisjunctionChoice::isSymmetricOperator() const {
2209
2212
}
2210
2213
2211
2214
void DisjunctionChoice::propagateConversionInfo () const {
2212
- if (!CS->isExplicitConversionConstraint (Disjunction))
2213
- return ;
2215
+ assert (ExplicitConversion);
2214
2216
2215
2217
auto LHS = Choice->getFirstType ();
2216
2218
auto typeVar = LHS->getAs <TypeVariableType>();
0 commit comments