@@ -471,7 +471,11 @@ struct SynthesizedExtensionAnalyzer::Implementation {
471
471
// We want to visit the protocols of any normal conformances we see, but
472
472
// we have to avoid doing this to self-conformances or we can end up with
473
473
// a cycle. Otherwise this is cycle-proof on valid code.
474
+ // We also want to ignore inherited conformances. Members from these will
475
+ // be included in the class they were inherited from.
474
476
auto addConformance = [&](ProtocolConformance *Conf) {
477
+ if (isa<InheritedProtocolConformance>(Conf))
478
+ return ;
475
479
auto RootConf = Conf->getRootConformance ();
476
480
if (isa<NormalProtocolConformance>(RootConf))
477
481
Unhandled.push_back (RootConf->getProtocol ());
@@ -480,10 +484,6 @@ struct SynthesizedExtensionAnalyzer::Implementation {
480
484
for (auto *Conf : Target->getLocalConformances ()) {
481
485
addConformance (Conf);
482
486
}
483
- if (auto *CD = dyn_cast<ClassDecl>(Target)) {
484
- if (auto Super = CD->getSuperclassDecl ())
485
- Unhandled.push_back (Super);
486
- }
487
487
while (!Unhandled.empty ()) {
488
488
NominalTypeDecl* Back = Unhandled.back ();
489
489
Unhandled.pop_back ();
@@ -493,10 +493,6 @@ struct SynthesizedExtensionAnalyzer::Implementation {
493
493
for (auto *Conf : Back->getLocalConformances ()) {
494
494
addConformance (Conf);
495
495
}
496
- if (auto *CD = dyn_cast<ClassDecl>(Back)) {
497
- if (auto Super = CD->getSuperclass ())
498
- Unhandled.push_back (Super->getAnyNominal ());
499
- }
500
496
}
501
497
502
498
// Merge with actual extensions.
0 commit comments