2 ms·
Equatable and Hashable also have some "magic", currently only for enums without associated values. Recently this was generalized to enums where all associated v
by slavapestov 9y ago
Equatable and Hashable also have some "magic", currently only for enums without associated values. Recently this was generalized to enums where all associated values are themselves Equatable and Hashable, as well as structs where all fields are Equatable and Hashable. This is not implemented in Swift 4, but an implementation was recently added to the master branch. You can read the details here: https://github.com/apple/swift-evolution/blob/master/proposals/0185-synthesize-equatable-hashable.md https://github.com/apple/swift-evolution/blob/master/proposa...