@@ -88,25 +88,6 @@ PrintOptions PrintOptions::printDocInterface() {
88
88
return result;
89
89
}
90
90
91
- // / Erase any associated types within dependent member types, so we'll resolve
92
- // / them again.
93
- static Type eraseAssociatedTypes (Type type) {
94
- if (!type->hasTypeParameter ()) return type;
95
-
96
- return type.transformRec ([](TypeBase *type) -> Optional<Type> {
97
- if (auto depMemType = dyn_cast<DependentMemberType>(type)) {
98
- auto newBase = eraseAssociatedTypes (depMemType->getBase ());
99
- if (newBase.getPointer () == depMemType->getBase ().getPointer () &&
100
- !depMemType->getAssocType ())
101
- return None;
102
-
103
- return Type (DependentMemberType::get (newBase, depMemType->getName ()));
104
- }
105
-
106
- return None;
107
- });
108
- }
109
-
110
91
struct SynthesizedExtensionAnalyzer ::Implementation {
111
92
static bool isMemberFavored (const NominalTypeDecl* Target, const Decl* D) {
112
93
DeclContext* DC = Target->getInnermostDeclContext ();
@@ -186,11 +167,9 @@ struct SynthesizedExtensionAnalyzer::Implementation {
186
167
std::set<Requirement> Requirements;
187
168
void addRequirement (GenericSignature *GenericSig,
188
169
Type First, Type Second, RequirementKind Kind) {
189
- CanType CanFirst =
190
- GenericSig->getCanonicalTypeInContext (eraseAssociatedTypes (First));
170
+ CanType CanFirst = GenericSig->getCanonicalTypeInContext (First);
191
171
CanType CanSecond;
192
- if (Second) CanSecond =
193
- GenericSig->getCanonicalTypeInContext (eraseAssociatedTypes (Second));
172
+ if (Second) CanSecond = GenericSig->getCanonicalTypeInContext (Second);
194
173
195
174
Requirements.insert ({First, Second, Kind, CanFirst, CanSecond});
196
175
}
0 commit comments