@@ -1172,23 +1172,6 @@ AssociatedTypeInference::AssociatedTypeInference(
11721172 : ctx(ctx), conformance(conformance), proto(conformance->getProtocol ()),
11731173 dc(conformance->getDeclContext ()), adoptee(conformance->getType ()) {}
11741174
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-
11921175namespace {
11931176
11941177// / Try to avoid situations where resolving the type of a witness calls back
@@ -1428,8 +1411,6 @@ static InferenceCandidateKind checkInferenceCandidate(
14281411 NormalProtocolConformance *conformance,
14291412 ValueDecl *witness,
14301413 Type selfTy) {
1431- auto &ctx = selfTy->getASTContext ();
1432-
14331414 // The unbound form of `Self.A`.
14341415 auto selfAssocTy = DependentMemberType::get (selfTy, result->first ->getName ());
14351416 auto genericSig = witness->getInnermostDeclContext ()
@@ -1855,16 +1836,6 @@ AssociatedTypeInference::inferTypeWitnessesViaValueWitnesses(
18551836 return result;
18561837}
18571838
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-
18681839// / Desugar protocol type aliases, since they can cause request cycles in
18691840// / type resolution if printed in a module interface and parsed back in.
18701841static Type getWithoutProtocolTypeAliases (Type type) {
@@ -1937,8 +1908,6 @@ static Type getWitnessTypeForMatching(NormalProtocolConformance *conformance,
19371908 LookUpConformanceInModule (module ));
19381909 }
19391910
1940- auto &ctx = conformance->getDeclContext ()->getASTContext ();
1941-
19421911 auto proto = conformance->getProtocol ();
19431912 auto selfTy = proto->getSelfInterfaceType ();
19441913
@@ -2906,8 +2875,6 @@ AssociatedTypeDecl *AssociatedTypeInference::inferAbstractTypeWitnesses(
29062875 // not resolve otherwise.
29072876 llvm::SmallVector<AbstractTypeWitness, 2 > abstractTypeWitnesses;
29082877
2909- auto selfTypeInContext = dc->getSelfTypeInContext ();
2910-
29112878 TypeWitnessSystem system (unresolvedAssocTypes);
29122879 collectAbstractTypeWitnesses (system, unresolvedAssocTypes);
29132880
0 commit comments