Skip to content

Commit ef91e2e

Browse files
committed
[stdlib] Fix key path components hashing.
Removes shadowed `hasher` argument in component hashing.
1 parent 6982d65 commit ef91e2e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

stdlib/public/core/KeyPath.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ internal enum KeyPathComponent: Hashable {
597597

598598
@_effects(releasenone)
599599
internal func hash(into hasher: inout Hasher) {
600-
var hasher = hasher
601600
func appendHashFromArgument(
602601
_ argument: KeyPathComponent.ArgumentRef?
603602
) {

test/stdlib/KeyPathImplementation.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,10 @@ keyPathImpl.test("equality") {
657657
}
658658

659659
expectNotEqual(s_c_z_p_x, s_c_z_p_y)
660+
expectNotEqual(s_c_z_p_x.hashValue, s_c_z_p_y.hashValue)
661+
660662
expectNotEqual(s_c_z_p_y, s_c_z_p_x)
663+
expectNotEqual(s_c_z_p_y.hashValue, s_c_z_p_x.hashValue)
661664

662665
// Different path type
663666
let s_c_z_p = ReferenceWritableKeyPath<S<S<String>>, Point>

0 commit comments

Comments
 (0)