@@ -42,9 +42,6 @@ struct RewriteSystemBuilder {
42
42
void addGenericSignature (CanGenericSignature sig);
43
43
void addAssociatedType (const AssociatedTypeDecl *type,
44
44
const ProtocolDecl *proto);
45
- void addInheritedAssociatedType (const AssociatedTypeDecl *type,
46
- const ProtocolDecl *inherited,
47
- const ProtocolDecl *proto);
48
45
void addRequirement (const Requirement &req,
49
46
const ProtocolDecl *proto);
50
47
};
@@ -70,13 +67,6 @@ void RewriteSystemBuilder::addGenericSignature(CanGenericSignature sig) {
70
67
for (auto *type : info.AssociatedTypes )
71
68
addAssociatedType (type, proto);
72
69
73
- for (auto *inherited : info.Inherited ) {
74
- auto inheritedTypes = Protocols.getProtocolInfo (inherited).AssociatedTypes ;
75
- for (auto *inheritedType : inheritedTypes) {
76
- addInheritedAssociatedType (inheritedType, inherited, proto);
77
- }
78
- }
79
-
80
70
for (auto req : info.Requirements )
81
71
addRequirement (req.getCanonical (), proto);
82
72
@@ -108,29 +98,6 @@ void RewriteSystemBuilder::addAssociatedType(const AssociatedTypeDecl *type,
108
98
Rules.emplace_back (lhs, rhs);
109
99
}
110
100
111
- // / For an associated type T in a protocol Q that is inherited by another
112
- // / protocol P, we add a rewrite rule:
113
- // /
114
- // / [P].[Q:T] => [P:T]
115
- // /
116
- // / Intuitively this means, "if a type conforms to P, then the associated type
117
- // / T of Q is inherited by P".
118
- void RewriteSystemBuilder::addInheritedAssociatedType (
119
- const AssociatedTypeDecl *type,
120
- const ProtocolDecl *inherited,
121
- const ProtocolDecl *proto) {
122
- assert (inherited != proto);
123
-
124
- Term lhs;
125
- lhs.add (Atom::forProtocol (proto, Context));
126
- lhs.add (Atom::forAssociatedType (inherited, type->getName (), Context));
127
-
128
- Term rhs;
129
- rhs.add (Atom::forAssociatedType (proto, type->getName (), Context));
130
-
131
- Rules.emplace_back (lhs, rhs);
132
- }
133
-
134
101
// / Lowers a generic requirement to a rewrite rule.
135
102
// /
136
103
// / If \p proto is null, this is a generic requirement from the top-level
0 commit comments