@@ -126,33 +126,6 @@ void ConstraintSystem::mergeEquivalenceClasses(TypeVariableType *typeVar1,
126
126
// Merge nodes in the constraint graph.
127
127
CG.mergeNodes (typeVar1, typeVar2);
128
128
129
- // Let's try to de-duplicate any generic requirements
130
- // associated with given type variable, if it represents
131
- // a generic parameter.
132
- if (typeVar1->getImpl ().getGenericParameter ()) {
133
- auto requirements = CG.gatherConstraints (
134
- typeVar1, ConstraintGraph::GatheringKind::EquivalenceClass,
135
- [](Constraint *constraint) -> bool {
136
- if (auto *locator = constraint->getLocator ()) {
137
- return locator->isLastElement (
138
- ConstraintLocator::TypeParameterRequirement) ||
139
- locator->isLastElement (
140
- ConstraintLocator::ConditionalRequirement);
141
- }
142
-
143
- return false ;
144
- });
145
-
146
- llvm::SmallPtrSet<TypeBase *, 4 > existingRequirements;
147
- for (auto *req : requirements) {
148
- auto constraintTy = req->getSecondType ();
149
- // If this constraint has already been recorded in the
150
- // constraint system, there is no reason to check it twice.
151
- if (!existingRequirements.insert (constraintTy.getPointer ()).second )
152
- retireConstraint (req);
153
- }
154
- }
155
-
156
129
if (updateWorkList) {
157
130
addTypeVariableConstraintsToWorkList (typeVar1);
158
131
}
0 commit comments