@@ -1172,23 +1172,6 @@ AssociatedTypeInference::AssociatedTypeInference(
1172
1172
: ctx(ctx), conformance(conformance), proto(conformance->getProtocol ()),
1173
1173
dc(conformance->getDeclContext ()), adoptee(conformance->getType ()) {}
1174
1174
1175
- static bool associatedTypesAreSameEquivalenceClass (AssociatedTypeDecl *a,
1176
- AssociatedTypeDecl *b) {
1177
- if (a == b)
1178
- return true ;
1179
-
1180
- // TODO: Do a proper equivalence check here by looking for some relationship
1181
- // between a and b's protocols. In practice today, it's unlikely that
1182
- // two same-named associated types can currently be independent, since we
1183
- // don't have anything like `@implements(P.foo)` to rename witnesses (and
1184
- // we still fall back to name lookup for witnesses in more cases than we
1185
- // should).
1186
- if (a->getName () == b->getName ())
1187
- return true ;
1188
-
1189
- return false ;
1190
- }
1191
-
1192
1175
namespace {
1193
1176
1194
1177
// / Try to avoid situations where resolving the type of a witness calls back
@@ -1428,8 +1411,6 @@ static InferenceCandidateKind checkInferenceCandidate(
1428
1411
NormalProtocolConformance *conformance,
1429
1412
ValueDecl *witness,
1430
1413
Type selfTy) {
1431
- auto &ctx = selfTy->getASTContext ();
1432
-
1433
1414
// The unbound form of `Self.A`.
1434
1415
auto selfAssocTy = DependentMemberType::get (selfTy, result->first ->getName ());
1435
1416
auto genericSig = witness->getInnermostDeclContext ()
@@ -1855,16 +1836,6 @@ AssociatedTypeInference::inferTypeWitnessesViaValueWitnesses(
1855
1836
return result;
1856
1837
}
1857
1838
1858
- // / Map error types back to their original types.
1859
- static Type mapErrorTypeToOriginal (Type type) {
1860
- if (auto errorType = type->getAs <ErrorType>()) {
1861
- if (auto originalType = errorType->getOriginalType ())
1862
- return originalType.transform (mapErrorTypeToOriginal);
1863
- }
1864
-
1865
- return type;
1866
- }
1867
-
1868
1839
// / Desugar protocol type aliases, since they can cause request cycles in
1869
1840
// / type resolution if printed in a module interface and parsed back in.
1870
1841
static Type getWithoutProtocolTypeAliases (Type type) {
@@ -1937,8 +1908,6 @@ static Type getWitnessTypeForMatching(NormalProtocolConformance *conformance,
1937
1908
LookUpConformanceInModule (module ));
1938
1909
}
1939
1910
1940
- auto &ctx = conformance->getDeclContext ()->getASTContext ();
1941
-
1942
1911
auto proto = conformance->getProtocol ();
1943
1912
auto selfTy = proto->getSelfInterfaceType ();
1944
1913
@@ -2906,8 +2875,6 @@ AssociatedTypeDecl *AssociatedTypeInference::inferAbstractTypeWitnesses(
2906
2875
// not resolve otherwise.
2907
2876
llvm::SmallVector<AbstractTypeWitness, 2 > abstractTypeWitnesses;
2908
2877
2909
- auto selfTypeInContext = dc->getSelfTypeInContext ();
2910
-
2911
2878
TypeWitnessSystem system (unresolvedAssocTypes);
2912
2879
collectAbstractTypeWitnesses (system, unresolvedAssocTypes);
2913
2880
0 commit comments