I found a rationale by @itaiferber in the pitch discussion for synthesizing Equatable
(this mainly talks about Codable
but also refers to the planned synthesis for Equatable
/Hashable
):
Derived conformance for Codable ignores all computed properties (including lazy properties and their associated storage). … [The thought process here is that accessing computed vars (and more so lazy vars) will generally have side effects. We don’t want to trigger side effects on encoding/checking for equality/hashing, and in general, those types of properties will not affect equality/hash value/encoded representation.]
— Pitch: Automatically deriving Equatable/Hashable for more value types - #49 by itaiferber