Avatar
Avatar
tarunon
@swift-5.6.3 struct S<X> { var x: X } extension S: Hashable where X: Equatable { var hashValue: Int { 1 } } extension S: Equatable where X: Hashable {}
swift56 BOT 9/9/2023 4:48 PM
exit status: 1 with <stdin>:2:1: error: type 'X' does not conform to protocol 'Hashable' extension S: Hashable where X: Equatable { ^ <stdin>:2:1: error: 'Hashable' requires that 'X' conform to 'Hashable' extension S: Hashable where X: Equatable { ^ <stdin>:2:1: note: requirement specified as 'X' : 'Hashable' extension S: Hashable where X: Equatable { ^ <stdin>:2:1: note: requirement from conditional conformance of 'S<X>' to 'Equatable' extension S: Hashable where X: Equatable { ^ <stdin>:3:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'S' to 'Hashable' by implementing 'hash(into:)' instead var hashValue: Int { 1 } ^