@@ -657,7 +657,10 @@ keyPathImpl.test("equality") {
657
657
}
658
658
659
659
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
+
660
662
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)
661
664
662
665
// Different path type
663
666
let s_c_z_p = ReferenceWritableKeyPath < S < S < String > > , Point >
@@ -677,6 +680,24 @@ keyPathImpl.test("equality") {
677
680
expectNotEqual ( s_c_z_p_x, s_c_z_p)
678
681
expectNotEqual ( s_c_z_p, s_c_z_p_x)
679
682
683
+ let s_x = WritableKeyPath < S < String > , Int >
684
+ . build ( capacityInBytes: MemoryLayout < Int > . size + 4 ) {
685
+ $0. addHeader ( trivial: true , hasReferencePrefix: false )
686
+ $0. addStructComponent ( offset: S< String> . x_offset)
687
+ }
688
+
689
+ let si_x = WritableKeyPath < S < Int > , Int >
690
+ . build ( capacityInBytes: MemoryLayout < Int > . size + 4 ) {
691
+ $0. addHeader ( trivial: true , hasReferencePrefix: false )
692
+ $0. addStructComponent ( offset: S< Int> . x_offset)
693
+ }
694
+
695
+ expectNotEqual ( s_x, si_x)
696
+ expectNotEqual ( s_x. hashValue, si_x. hashValue)
697
+
698
+ expectNotEqual ( si_x, s_x)
699
+ expectNotEqual ( si_x. hashValue, s_x. hashValue)
700
+
680
701
// Same path, no reference prefix
681
702
let s_c_z_p_x_readonly = KeyPath < S < S < String > > , Double >
682
703
. build ( capacityInBytes: 7 * MemoryLayout < Int > . size + 4 ) {
0 commit comments