Skip to content

Commit d76db19

Browse files
committed
Sema: Resolve unused variable and function warnings.
NFC.
1 parent c0303e0 commit d76db19

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

lib/Sema/AssociatedTypeInference.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
11921175
namespace {
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.
18701841
static 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

lib/Sema/CSDiagnostics.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8202,7 +8202,6 @@ bool UnableToInferClosureReturnType::diagnoseAsError() {
82028202

82038203
bool UnableToInferGenericPackElementType::diagnoseAsError() {
82048204
auto *locator = getLocator();
8205-
auto path = locator->getPath();
82068205

82078206
auto packElementElt = locator->getLastElementAs<LocatorPathElt::PackElement>();
82088207
assert(packElementElt && "Expected path to end with a pack element locator");

0 commit comments

Comments
 (0)