swift-spyable icon indicating copy to clipboard operation
swift-spyable copied to clipboard

Support `@unchecked Sendable`

Open crane-hiromu opened this issue 4 months ago • 0 comments

Thank you for creating this library 🤝


Is your feature request related to a problem? Please describe.

Coucnrrency compliance is required in Xcode 15.3 or later. Compliance with Sendable will result in a warning in the generated Spy.

  • example(on Xcode15.3)
Screenshot 2024-04-22 at 19 14 37



Describe the solution you'd like

You can solve this by adding @unchecked Sendable to the generated Spy.

  • example code
class XxxxCaseProtocolSpy: XxxxCaseProtocol, @unchecked Sendable {

or

extension XxxxCaseProtocolSpy: @unchecked Sendable {}



Describe alternatives you've considered

It would be nice if implementers could optionally choose whether to unchecked or not.

  • example code
@Spyable(behindPreprocessorFlag: "DEBUG", uncheckedSendable: true)



I was going to make my own PR, but it seemed difficult to modify it with my knowledge, sorry...

I hope you'll address this issue. Thank you 👍

crane-hiromu avatar Apr 22 '24 10:04 crane-hiromu