File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -4385,6 +4385,19 @@ void GenericSignatureBuilder::checkConformanceConstraints(
4385
4385
auto proto = constraint.value ;
4386
4386
assert (proto == entry.first && " Mixed up protocol constraints" );
4387
4387
4388
+ // If this conformance requirement recursively makes a protocol
4389
+ // conform to itself, don't complain here.
4390
+ auto source = constraint.source ;
4391
+ auto rootSource = source->getRoot ();
4392
+ if (rootSource->kind == RequirementSource::RequirementSignatureSelf &&
4393
+ source != rootSource &&
4394
+ proto == rootSource->getProtocolDecl () &&
4395
+ rootSource->getRootPotentialArchetype ()
4396
+ ->isInSameEquivalenceClassAs (
4397
+ source->getAffectedPotentialArchetype ())) {
4398
+ return ConstraintRelation::Unrelated;
4399
+ }
4400
+
4388
4401
// If this is a redundantly inherited Objective-C protocol, treat it
4389
4402
// as "unrelated" to silence the warning about the redundant
4390
4403
// conformance.
You can’t perform that action at this time.
0 commit comments