infix operator |||
protocol OperatorRequired{
static func ||| (lhs: Self, rhs: Self) -> Bool
}
class AdoptingClass: OperatorRequired{
}
func ||| (lhs: AdoptingClass, rhs: AdoptingClass) -> Bool{
return true
}
Although the class itself hasn't conformed to the protocol, the above code compiles. WHY?!
This is with Xcode9.4
It seems that Xcode is being extremely smart here as if the protocol witness table is not checked at the class level rather it's checked at a global level.