Open RJPoelstra opened 9 months ago
That's a good question. I think we already went through attempting to make Codable
conditional in an earlier version of Swift but ran into some compiler limitations. I would guess this is possible now.
A couple alternatives you could do for now:
Codable
conformance to an existing data type in an extension that just ignores the values that are not possible to make Codable
Thanks for the suggestions. I'll look into them.
+1
Hi,
Native swift types like
Array
only conform toCodable
when their elements areCodable
. It looks likeGraph
doesn't have any special need for beingCodable
. Would it be possible to makeGraph
conform toCodable
only when its vertices are? I've a use case where I'm not interested in theGraph
being codable and adding conformance to the vertex type would be a lot of work.