Using the extension does satisfy the warning, but now I can’t seem to use the method. In a test, I have this line:
XCTAssertTrue(edge == edge)
And this fails to compile with the error Binary operator '==' cannot be applied to two 'ViewEdgeConvertible' operands
. This is what I have for ==
:
extension ViewEdgeConvertible {
public static func == (
lhs: ViewEdgeConvertible,
rhs: ViewEdgeConvertible
) -> Bool {
return lhs.fixedViewEdge(using: nil) == rhs.fixedViewEdge(using: nil)
}
}
Using the workaround from @Jumhyn, I can at least call ==
from a test. Very odd.