Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions lib/IDE/IDETypeChecking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,11 @@ struct SynthesizedExtensionAnalyzer::Implementation {
// We want to visit the protocols of any normal conformances we see, but
// we have to avoid doing this to self-conformances or we can end up with
// a cycle. Otherwise this is cycle-proof on valid code.
// We also want to ignore inherited conformances. Members from these will
// be included in the class they were inherited from.
auto addConformance = [&](ProtocolConformance *Conf) {
if (isa<InheritedProtocolConformance>(Conf))
return;
auto RootConf = Conf->getRootConformance();
if (isa<NormalProtocolConformance>(RootConf))
Unhandled.push_back(RootConf->getProtocol());
Expand All @@ -480,10 +484,6 @@ struct SynthesizedExtensionAnalyzer::Implementation {
for (auto *Conf : Target->getLocalConformances()) {
addConformance(Conf);
}
if (auto *CD = dyn_cast<ClassDecl>(Target)) {
if (auto Super = CD->getSuperclassDecl())
Unhandled.push_back(Super);
}
while (!Unhandled.empty()) {
NominalTypeDecl* Back = Unhandled.back();
Unhandled.pop_back();
Expand All @@ -493,10 +493,6 @@ struct SynthesizedExtensionAnalyzer::Implementation {
for (auto *Conf : Back->getLocalConformances()) {
addConformance(Conf);
}
if (auto *CD = dyn_cast<ClassDecl>(Back)) {
if (auto Super = CD->getSuperclass())
Unhandled.push_back(Super->getAnyNominal());
}
}

// Merge with actual extensions.
Expand Down
Loading