Avatar
@swift-5.8.1 class A: Equatable { static func ==(lhs: A, rhs: A) -> Bool { print("A") return lhs === rhs } } class B: A {} class C: B { static func ==(lhs: C, rhs: C) -> Bool { print("C") return lhs === rhs } } struct Foo<T: Equatable> { func bar(_ x: T, _ y: T) -> Bool { x == y } } let c: C = .init() print(Foo<A>().bar(c, c)) print(Foo<B>().bar(c, c)) print(Foo<C>().bar(c, c))