We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db7d1e7 commit 10f0d27Copy full SHA for 10f0d27
lib/AST/ASTContext.cpp
@@ -2456,6 +2456,14 @@ ASTContext::getSpecializedConformance(Type type,
2456
2457
InheritedProtocolConformance *
2458
ASTContext::getInheritedConformance(Type type, ProtocolConformance *inherited) {
2459
+ // Collapse multiple levels of inherited conformance.
2460
+ while (auto *otherInherited = dyn_cast<InheritedProtocolConformance>(inherited))
2461
+ inherited = otherInherited->getInheritedConformance();
2462
+
2463
+ assert(isa<SpecializedProtocolConformance>(inherited) ||
2464
+ isa<NormalProtocolConformance>(inherited) ||
2465
+ isa<BuiltinProtocolConformance>(inherited));
2466
2467
llvm::FoldingSetNodeID id;
2468
InheritedProtocolConformance::Profile(id, type, inherited);
2469
0 commit comments