File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ extension EquatableClazz: Hashable {
66
77 var hashValue: Int {
88 var hashValue = 1
9- let hashableVars: [Hashable ?] = [var0, var1, var2]
9+ let hashableVars: [AnyHashable ?] = [var0, var1, var2]
1010 hashableVars.forEach {
11- hashValue = 31 * hashValue + $0?.hashValue ?? 0
11+ hashValue = 31 * hashValue + ( $0?.hashValue ?? 0)
1212 }
1313 return hashValue
1414 }
Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ struct HashableGenerator: Generator {
4747 lines. append ( " \( indentation) var hashValue: Int { " )
4848 lines. append ( " \( indentation) \( indentation) var hashValue = 1 " )
4949 let hashableVars = varSignatures. map { $0. name } . joined ( separator: " , " )
50- var varsType = " [Hashable ] "
50+ var varsType = " [AnyHashable ] "
5151 var varHash = " $0.hashValue "
5252 if ( varSignatures. filter { $0. type. isOptional } ) . count > 0 {
53- varsType = " [Hashable ?] "
54- varHash = " $0?.hashValue ?? 0 "
53+ varsType = " [AnyHashable ?] "
54+ varHash = " ( $0?.hashValue ?? 0) "
5555 }
5656 lines. append ( " \( indentation) \( indentation) let hashableVars: \( varsType) = [ \( hashableVars) ] " )
5757
You can’t perform that action at this time.
0 commit comments