Avatar
@swiftbot struct Value: Hashable { let id = 5 } struct Value2: Hashable { let id = 5 func hash(into hasher: inout Hasher) { hasher.combine(id) } } enum EnumValue: Hashable { case a(Int) case b(Int) } enum EnumValue2: Hashable { case a(Int) case b(Int) func hash(into hasher: inout Hasher) { switch self { case .a(let v): hasher.combine(v) case .b(let v): hasher.combine(v) } } } print(5.hashValue) print(Value().hashValue) print(Value2().hashValue) print(EnumValue.a(5).hashValue) print(EnumValue.b(5).hashValue) print(EnumValue2.a(5).hashValue) print(EnumValue2.b(5).hashValue)