Is there a difference between Protocols conforming to Protocols and Protocol Inheritance?
I'm trying to write this:
protocol Categorizable {
var category: Set<Category> { get set }
}
but Category doesn't conform to Hashable so I wrote this:
protocol Category: Hashable {
static var none: Self { get }
static func custom(_: String) -> Self
}
but I get this error:
protocol Categorizable {
var category: Set<Category> { get set } //Value of protocol type 'Category' cannot conform to 'Hashable'; only struct/enum/class types can conform to protocols
}
But I'm confused. I'm not even trying to conform a protocol to a protocol. I'm trying to make protocol Category
inherit from Hashable
. Is that the same thing as conforming a protocol to a protocol? Why doesn't this protocol want to inherit?