@@ -2092,7 +2092,6 @@ TypeDecl *EquivalenceClass::lookupNestedType(
2092
2092
2093
2093
// Look for types with the given name in protocols that we know about.
2094
2094
AssociatedTypeDecl *bestAssocType = nullptr ;
2095
- llvm::SmallSetVector<AssociatedTypeDecl *, 4 > assocTypeAnchors;
2096
2095
SmallVector<TypeDecl *, 4 > concreteDecls;
2097
2096
for (const auto &conforms : conformsTo) {
2098
2097
ProtocolDecl *proto = conforms.first ;
@@ -2104,7 +2103,6 @@ TypeDecl *EquivalenceClass::lookupNestedType(
2104
2103
if (auto assocType = dyn_cast<AssociatedTypeDecl>(member)) {
2105
2104
// Retrieve the associated type anchor.
2106
2105
assocType = assocType->getAssociatedTypeAnchor ();
2107
- assocTypeAnchors.insert (assocType);
2108
2106
2109
2107
if (!bestAssocType ||
2110
2108
compareAssociatedTypes (assocType, bestAssocType) < 0 )
@@ -2131,23 +2129,6 @@ TypeDecl *EquivalenceClass::lookupNestedType(
2131
2129
lookupConcreteNestedType (decl, name, concreteDecls);
2132
2130
}
2133
2131
2134
- // Infer same-type constraints among same-named associated type anchors.
2135
- if (assocTypeAnchors.size () > 1 ) {
2136
- auto anchorType = getAnchor (builder, builder.getGenericParams ());
2137
- auto inferredSource =
2138
- FloatingRequirementSource::forNestedTypeNameMatch (
2139
- assocTypeAnchors.front ()->getName ());
2140
- for (auto assocType : assocTypeAnchors) {
2141
- if (assocType == bestAssocType) continue ;
2142
-
2143
- builder.addRequirement (
2144
- Requirement (RequirementKind::SameType,
2145
- DependentMemberType::get (anchorType, bestAssocType),
2146
- DependentMemberType::get (anchorType, assocType)),
2147
- nullptr , inferredSource, nullptr , nullptr );
2148
- }
2149
- }
2150
-
2151
2132
// Form the new cache entry.
2152
2133
CachedNestedType entry;
2153
2134
entry.numConformancesPresent = conformsTo.size ();
0 commit comments