Make Asset and ImageAsset conform to Sendable#1119
Make Asset and ImageAsset conform to Sendable#1119SergeyPetrachkov wants to merge 3 commits intoSwiftGen:developfrom
Conversation
…ed code is Swift6- and strict-concurrency-checks- ready
| {% endmacro %} | ||
| // swiftlint:disable identifier_name line_length nesting type_body_length type_name | ||
| {{accessModifier}} enum {{enumName}} { | ||
| {{accessModifier}} enum {{enumName}}: Sendable { |
There was a problem hiding this comment.
I assume the template should be compatible with all Swift5 variants. Therefore I suggest the following:
| {{accessModifier}} enum {{enumName}}: Sendable { | |
| #if swift(>=5.7) | |
| {{accessModifier}} enum {{enumName}}: Sendable { | |
| #else | |
| {{accessModifier}} enum {{enumName}} { | |
| #endif |
If I'm wrong - just ignore the comment.
If I'm right - please apply the same to struct template below.
The Sendable protocol has been added to Swift 5.7, so it's not available in Swift 5.6 and earlier: SE-0302 Sendable and @Sendable closures
|
what holding this? we are suffering from that cause we have to add it manually everytime , we really need this ASAP |
|
I don't have writing access to the repo. Someone from the owners should do a review, approve and merge it 🤔 |
|
I think the owner left the project to no one it didn't got updated for 9 months or more. that's really bad. I would consider going to another things like R.swift or something to get this over with . |
|
Any update this PR? |
|
Thank you for authoring this. We're also facing the similar issue. We will appreciate if this could get merged that will unblock us from the Swift 6 transition work. |
What's done:
added Sendable conformance to ImageAsset and Asset types so the generated code is Swift6- and strict-concurrency-checks- ready. Since all types that are used in the equation are
Sendable, and sinceSendableis available iOS 8+, macOS 10.10+, watchOS 2.0+ (in other words from the very old versions), it should be safe to just add Sendable conformance to the swift5 stencil without introducing breaking changes. This will allow people to use the generated codes without any unwanted warnings from the compiler.I've started my branch from the
developbranch (gitflow)developas the "base" branch for this Pull Request I'm about to createI've added an entry in the
CHANGELOG.mdfile to explain my changes and credit myself(or added
#trivialto the PR title if I think it doesn't warrant a mention in the CHANGELOG)