Skip to content

Commit 18815fb

Browse files
tarunonrintaro
authored andcommitted
Improve sample code of deriveHashable_hashValue (swiftlang#13273)
Seems `SomeEnumWithAssociatedValues` implements require `result` initial value.
1 parent 20d9f21 commit 18815fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/DerivedConformanceEquatableHashable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,10 +1013,10 @@ deriveHashable_hashValue(TypeChecker &tc, Decl *parentDecl,
10131013
// case A:
10141014
// result = 0
10151015
// case B(let a0):
1016-
// result = _mixForSynthesizedHashValue(result, 1)
1016+
// result = 1
10171017
// result = _mixForSynthesizedHashValue(result, a0.hashValue)
10181018
// case C(let a0, let a1):
1019-
// result = _mixForSynthesizedHashValue(result, 2)
1019+
// result = 2
10201020
// result = _mixForSynthesizedHashValue(result, a0.hashValue)
10211021
// result = _mixForSynthesizedHashValue(result, a1.hashValue)
10221022
// }

0 commit comments

Comments
 (0)