GottaGetSwifty / CodableWrappers

A Collection of PropertyWrappers to make custom Serialization of Swift Codable Types easy
Apache License 2.0
603 stars 38 forks source link

Feature: Sendable @OptionalDecoding<ISO8601DateDecoding> and @ISO8601DateDecoding #41

Open adammcarter opened 4 months ago

adammcarter commented 4 months ago

I'm using the wrappers @OptionalDecoding<ISO8601DateDecoding> and @ISO8601DateDecoding in my struct to decode dates, but making the struct conform to Sendable gives warnings for the properties with these wrappers as they don't conform to Sendable themselves

It looks like I can silence the warnings from Xcode with the following:

extension ISO8601DateDecoding: @unchecked Sendable {}
extension OptionalDecoding: @unchecked Sendable {}

But is there a technical reason this isn't done as part of the wrappers? Or is has it just not been implemented yet?

GottaGetSwifty commented 2 months ago

I haven't tackled any Structured Concurrency issues with this yet. If I understand it correctly, I don't think this we be a problem. But I'd like to do a bit more research/testing on the effects before adding it. Would you be interested in a branch with this support for testing?