Skip to content

Commit 6f967da

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.
1 parent a8146d6 commit 6f967da

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
@@ -15391,14 +15391,21 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1539115391
case FixKind::MacroMissingPound:
1539215392
case FixKind::AllowGlobalActorMismatch:
1539315393
case FixKind::AllowAssociatedValueMismatch:
15394-
case FixKind::GenericArgumentsMismatch:
1539515394
case FixKind::AllowConcreteTypeSpecialization:
1539615395
case FixKind::AllowFunctionSpecialization:
1539715396
case FixKind::IgnoreGenericSpecializationArityMismatch:
1539815397
case FixKind::IgnoreKeyPathSubscriptIndexMismatch:
1539915398
case FixKind::AllowMemberRefOnExistential: {
1540015399
return recordFix(fix) ? SolutionKind::Error : SolutionKind::Solved;
1540115400
}
15401+
15402+
case FixKind::GenericArgumentsMismatch: {
15403+
unsigned impact = 1;
15404+
if (type1->isMarkerExistential() || type2->isMarkerExistential())
15405+
++impact;
15406+
return recordFix(fix, impact) ? SolutionKind::Error : SolutionKind::Solved;
15407+
}
15408+
1540215409
case FixKind::IgnoreThrownErrorMismatch: {
1540315410
return recordFix(fix, 2) ? SolutionKind::Error : SolutionKind::Solved;
1540415411
}

0 commit comments

Comments
 (0)