Sure, I just created a new project and added the file. Removed the bits which aren’t supported yet. I have attached the project (it’s just two files). I didn’t get it working with the latest 9.3 beta.
Ah, the problem with the filter() is not the call, but that you RETURN the result. your method is declared to return a [T], but filter() returns a sequence (this is a deliberate different between SBL and Apple’s implementation of filter, because (a) it’s the sensible thing to do and (b) whoever designs Apple’s Swift libraries does not understand how protocols and polymorphism should work and thus designs really shitty APIs.
you’ll either want to change the method to return an Sequence<T>, or call .ToList(), eg:
return array.filter({ (o) -> Bool in // <- error here
if let o = o as? Filterable {
return o.match(query: cleanQuery)
} else {
// if object isn't Filterable, always include it
return true
}
}).ToList()
(on an unrelated note, you need parenthesis around the (o), thats a recent change in Swift (3 iirc) to force those. that, or just { o in ... }).