@@ -985,19 +985,17 @@ void DerivedConformance::tryDiagnoseFailedHashableDerivation(
985
985
}
986
986
987
987
ValueDecl *DerivedConformance::deriveHashable (ValueDecl *requirement) {
988
- ASTContext &C = ConformanceDecl->getASTContext ();
989
-
990
988
// var hashValue: Int
991
- if (requirement->getBaseName () == C .Id_hashValue ) {
989
+ if (requirement->getBaseName () == Context .Id_hashValue ) {
992
990
// We always allow hashValue to be synthesized; invalid cases are diagnosed
993
991
// during hash(into:) synthesis.
994
992
return deriveHashable_hashValue (*this );
995
993
}
996
994
997
995
// Hashable.hash(into:)
998
- if (requirement->getBaseName () == C .Id_hash ) {
996
+ if (requirement->getBaseName () == Context .Id_hash ) {
999
997
// Start by resolving hashValue conformance.
1000
- auto hashValueReq = getHashValueRequirement (C );
998
+ auto hashValueReq = getHashValueRequirement (Context );
1001
999
auto conformance = getHashableConformance (ConformanceDecl);
1002
1000
auto hashValueDecl = conformance->getWitnessDecl (hashValueReq);
1003
1001
if (!hashValueDecl) {
@@ -1011,7 +1009,7 @@ ValueDecl *DerivedConformance::deriveHashable(ValueDecl *requirement) {
1011
1009
1012
1010
// Refuse to synthesize Hashable if type isn't a struct or enum, or if it
1013
1011
// has non-Hashable stored properties/associated values.
1014
- auto hashableProto = C .getProtocol (KnownProtocolKind::Hashable);
1012
+ auto hashableProto = Context .getProtocol (KnownProtocolKind::Hashable);
1015
1013
if (!canDeriveConformance (getConformanceContext (), Nominal,
1016
1014
hashableProto)) {
1017
1015
ConformanceDecl->diagnose (diag::type_does_not_conform,
0 commit comments