I have a struct that I copied over from Xcode where it compiles fine. Because structs with methods aren’t supported yet, I converted it to a class.
However, it still doesn’t compile. I get an error:
Method “static op_Equality(_ lhs: instancetype, _ rhs: instancetype) -> Bool” not implemented as required for interface. The protocol only requires the == method and it’s there.
This is my class:
public class SharedIndexPath: Equatable {
typealias Element = Int
var indices:[Element] = []
var count: Int {
return indices.count
}
var row: Int {
return indices[1]
}
var section: Int {
return indices[0]
}
public static func ==(lhs: SharedIndexPath, rhs: SharedIndexPath) -> Bool {
guard lhs.count == rhs.count else { return false }
return lhs.row == rhs.row && lhs.section == rhs.section
}
init() { }
init(indexes: [Element]) {
for index in indexes {
indices.append(index)
}
}
init(row: Int, section: Int = 0) {
indices.append(section)
indices.append(row)
}
}
Why won’t this compile under Silver? Fire version 10.0.0.2265