protocol CodableWithDefault: Codable {
static var `default`: Self { get }
}
extension Set: CodableWithDefault {
static var `default`: Set {
return Set()
}
}
This was working fine in Swift 4, but since 4.1 it complains:
'CodableWithDefault' requires that 'Element' conform to 'Encodable'
I could not find any way to express that I want to have an extension of Set
that is constrained to Element
also implement Encodable
.
Is this at all possible with Swift 4.1?