Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSwiftconditional conformanceSingle-choice MCQ

What does this conditional conformance achieve, and does it compile?

struct Pair<T> { let a: T; let b: T } extension Pair: Equatable where T: Equatable { static func == (lhs: Pair, rhs: Pair) -> Bool { lhs.a == rhs.a && lhs.b == rhs.b } } let x = Pair(a: 1, b: 2) == Pair(a: 1, b: 2)