No Equatable out of the box in swift for a struct

53 views Asked by At

I've declared my struct to conform to Equatable

struct LocationInfo: Equatable {

    // MARK: - Properties

    let gatewayId: GatewayId?
    let gatewaySerialNumber: String?
    let locationId: LocationId
    let locationName: String
    let role: UserRoleModel
    var rooms: [RoomInfo]
    let gateways: [GatewayInfo]
    var devices: [any DeviceInfoProtocol]
    let devicesGroups: [DeviceGroupsInfo]
    let membershipId: MembershipId?
    let partners: [PartnerConnection]
    let scripts: [AutomationScript]

all the types used are either String typealiases or Equatable or Hashable entities. All of them (I've checked and doublechecked). Why do I get

Type 'LocationInfo' does not conform to protocol 'Equatable'

and am therefore forced to implement == ?

0

There are 0 answers