Sounds ridiculous, but I\'m unable to fix this piece of code:
self.runningScripts.filter({ $0 != scriptRunner })
No matter how I write the
I needed an explicit cast like this:
@NSManaged private var storage: [String]
private var objects: Set<String>?
func remove(element:String) {
initSetIfNeeded()
if(objects!.contains(element)) {
objects!.remove(element)
storage = storage.filter({($0 as NSObject) !== (element as NSObject)}) // Explicit cast here!!
}
}
You can get that error if you didn't make ScriptRunner
conform to Equatable
:
class ScriptRunner : Equatable {
// the rest of your implementation here
}
func ==(lhs: ScriptRunner, rhs: ScriptRunner) -> Bool {
return ... // change this to whatever test that satisfies that lhs and rhs are equal
}