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 {
10451045 friend Score operator -(const Score &x, const Score &y) {
10461046 Score result;
10471047 for (unsigned i = 0 ; i != NumScoreKinds; ++i) {
1048+ ASSERT (x.Data [i] >= y.Data [i]);
10481049 result.Data [i] = x.Data [i] - y.Data [i];
10491050 }
10501051 return result;
10511052 }
10521053
10531054 friend Score &operator -=(Score &x, const Score &y) {
10541055 for (unsigned i = 0 ; i != NumScoreKinds; ++i) {
1056+ ASSERT (x.Data [i] >= y.Data [i]);
10551057 x.Data [i] -= y.Data [i];
10561058 }
10571059 return x;
Original file line number Diff line number Diff line change @@ -15032,9 +15032,12 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1503215032 SmallVector<Type, 4> unwraps2;
1503315033 type2->lookThroughAllOptionalTypes(unwraps2);
1503415034
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+
1503815041 return recordFix(fix, impact) ? SolutionKind::Error : SolutionKind::Solved;
1503915042 }
1504015043
You can’t perform that action at this time.
0 commit comments