Similar to the AnyClass case discussed in #2043, Any.Type causes compilation error.
Example:
struct MyStruct: Equatable {
let ty: Any.Type
// This cannot be synthesized because Any.Type is not Equatable.
static func == (lhs: Self, rhs: Self) -> Bool {
lhs.ty == rhs.ty
}
}
Current behavior:
SwiftFormat removes the == operator, causing a compilation error:
Type 'MyStruct' does not conform to protocol 'Equatable'
Expected behavior:
SwiftFormat should preserve the manual == implementation when any stored property's type does not conform to Equatable, even if == is available as a free function.
Environment:
Similar to the
AnyClasscase discussed in #2043,Any.Typecauses compilation error.Example:
Current behavior:
SwiftFormat removes the
==operator, causing a compilation error:Expected behavior:
SwiftFormat should preserve the manual
==implementation when any stored property's type does not conform toEquatable, even if==is available as a free function.Environment: