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