I've just updated to Xcode 10.2 and my formerly compiling extension can't compile anymore:
extension Array where Element == StringProtocol? {
func joined(by separator: String = " ") -> String {
return compactMap { $0?.description }.joined(separator: separator)
}
}
The famous Protocol 'StringProtocol' can only be used as a generic constraint because it has Self or associated type requirements
error now shows up...
Someone can tell me what happened? I have not migrated to Swift 5, just opened my project.
I have changed to:
extension Array where Element == CustomStringConvertible?
But I would like to understand why this changed... Any idea?