Skip to content

Commit 18c05a5

Browse files
committed
IDE: Remove dead workaround
1 parent fbb1537 commit 18c05a5

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

lib/IDE/IDETypeChecking.cpp

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,6 @@ PrintOptions PrintOptions::printDocInterface() {
8888
return result;
8989
}
9090

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-
11091
struct SynthesizedExtensionAnalyzer::Implementation {
11192
static bool isMemberFavored(const NominalTypeDecl* Target, const Decl* D) {
11293
DeclContext* DC = Target->getInnermostDeclContext();
@@ -186,11 +167,9 @@ struct SynthesizedExtensionAnalyzer::Implementation {
186167
std::set<Requirement> Requirements;
187168
void addRequirement(GenericSignature *GenericSig,
188169
Type First, Type Second, RequirementKind Kind) {
189-
CanType CanFirst =
190-
GenericSig->getCanonicalTypeInContext(eraseAssociatedTypes(First));
170+
CanType CanFirst = GenericSig->getCanonicalTypeInContext(First);
191171
CanType CanSecond;
192-
if (Second) CanSecond =
193-
GenericSig->getCanonicalTypeInContext(eraseAssociatedTypes(Second));
172+
if (Second) CanSecond = GenericSig->getCanonicalTypeInContext(Second);
194173

195174
Requirements.insert({First, Second, Kind, CanFirst, CanSecond});
196175
}

0 commit comments

Comments
 (0)