Skip to content

Commit c7a53bf

Browse files
committed
[CSSimplify] Increase generic argument mismatch score when matched against marker protocol
This indicates that the type doesn't have appropriate annotations i.e. for concurrency or ownership. (cherry picked from commit 6f967da)
1 parent 3765a59 commit c7a53bf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15326,14 +15326,21 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1532615326
case FixKind::MacroMissingPound:
1532715327
case FixKind::AllowGlobalActorMismatch:
1532815328
case FixKind::AllowAssociatedValueMismatch:
15329-
case FixKind::GenericArgumentsMismatch:
1533015329
case FixKind::AllowConcreteTypeSpecialization:
1533115330
case FixKind::AllowFunctionSpecialization:
1533215331
case FixKind::IgnoreGenericSpecializationArityMismatch:
1533315332
case FixKind::IgnoreKeyPathSubscriptIndexMismatch:
1533415333
case FixKind::AllowMemberRefOnExistential: {
1533515334
return recordFix(fix) ? SolutionKind::Error : SolutionKind::Solved;
1533615335
}
15336+
15337+
case FixKind::GenericArgumentsMismatch: {
15338+
unsigned impact = 1;
15339+
if (type1->isMarkerExistential() || type2->isMarkerExistential())
15340+
++impact;
15341+
return recordFix(fix, impact) ? SolutionKind::Error : SolutionKind::Solved;
15342+
}
15343+
1533715344
case FixKind::IgnoreThrownErrorMismatch: {
1533815345
return recordFix(fix, 2) ? SolutionKind::Error : SolutionKind::Solved;
1533915346
}

0 commit comments

Comments
 (0)