File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1045,13 +1045,15 @@ struct Score {
1045
1045
friend Score operator -(const Score &x, const Score &y) {
1046
1046
Score result;
1047
1047
for (unsigned i = 0 ; i != NumScoreKinds; ++i) {
1048
+ ASSERT (x.Data [i] >= y.Data [i]);
1048
1049
result.Data [i] = x.Data [i] - y.Data [i];
1049
1050
}
1050
1051
return result;
1051
1052
}
1052
1053
1053
1054
friend Score &operator -=(Score &x, const Score &y) {
1054
1055
for (unsigned i = 0 ; i != NumScoreKinds; ++i) {
1056
+ ASSERT (x.Data [i] >= y.Data [i]);
1055
1057
x.Data [i] -= y.Data [i];
1056
1058
}
1057
1059
return x;
Original file line number Diff line number Diff line change @@ -15032,9 +15032,12 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
15032
15032
SmallVector<Type, 4> unwraps2;
15033
15033
type2->lookThroughAllOptionalTypes(unwraps2);
15034
15034
15035
- auto impact = unwraps1.size() != unwraps2.size()
15036
- ? unwraps1.size() - unwraps2.size()
15037
- : 1;
15035
+ unsigned impact = 1;
15036
+ if (unwraps1.size() > unwraps2.size())
15037
+ impact = unwraps1.size() - unwraps2.size();
15038
+ else if (unwraps2.size() > unwraps1.size())
15039
+ impact = unwraps2.size() - unwraps1.size();
15040
+
15038
15041
return recordFix(fix, impact) ? SolutionKind::Error : SolutionKind::Solved;
15039
15042
}
15040
15043
You can’t perform that action at this time.
0 commit comments