Redundant conformance of 'Generic' to protocol 'Equatable' in Swift 2.2
A class inheriting NSObject
already conforms to Equatable
. So declaring Object: Equatable
is redundant.
However, the conformance does not mean that it has been implemented properly (NSObject
just checks whether the pointers are the same). If you wish to properly implement Equatable
for NSObject
, just exclude the protocol conformance statement (: Equatable
), but still implement the comparison method:
static func ==(lhs: Object, rhs: Object) -> Bool { return lhs.text == rhs.text}