Protocolo Swift implementa equável
Eu tenho o abaixoProtocol
:
protocol Cacheable {
//....//
func identifier() -> String
}
Posso fazerCacheable
implementa Equatable?
quando eu faço o seguinte:
extension Cacheable: Equatable {}
func ==(lhs:Cacheable,rhs:Cacheable) -> Bool {
return lhs.identifier() == rhs.identifier()
}
Recebi esta mensagem de erro:Extensão do protocoloCacheable
não pode ter uma cláusula de herança