Skip to content

Commit 3418f47

Browse files
committed
RequirementMachine: Actually compute the inherited protocol transitive closure
1 parent 3803767 commit 3418f47

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/AST/RequirementMachine/ProtocolGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void ProtocolGraph::computeInheritedAssociatedTypes() {
132132
void ProtocolGraph::computeInheritedProtocols() {
133133
// Visit protocols in reverse order, so that if P inherits from Q and
134134
// Q inherits from R, we first visit R, then Q, then P, ensuring that
135-
// R's associated types are added to P's list, etc.
135+
// R's inherited protocols are added to P's list, etc.
136136
for (const auto *proto : llvm::reverse(Protocols)) {
137137
auto &info = Info[proto];
138138

lib/AST/RequirementMachine/RequirementMachine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ void RewriteSystemBuilder::addGenericSignature(CanGenericSignature sig) {
8585
Protocols.visitRequirements(sig->getRequirements());
8686
Protocols.computeTransitiveClosure();
8787
Protocols.computeLinearOrder();
88+
Protocols.computeInheritedProtocols();
8889
Protocols.computeInheritedAssociatedTypes();
8990

9091
// Add rewrite rules for each protocol.

0 commit comments

Comments
 (0)