For mock classes that are required to conform to the Sendable protocol, I have made them inherit from @unchecked Sendable. This change should help reduce the number of unnecessary compiler warnings.
Examples
Source
protocol SendableProtocol: Sendable {}
class UncheckedSendableClass: @unchecked Sendable {}
final class SendableClass: Sendable {}
Output
class SendableProtocolMock: SendableProtocol, @unchecked Sendable {}
class UncheckedSendableClassMock: UncheckedSendableClass, @unchecked Sendable {}
// final class SendableClass is skipped, because final class can't make a mock class.
Summary
I have implemented the enhancements proposed in issue https://github.com/uber/mockolo/issues/252.
For mock classes that are required to conform to the
Sendable
protocol, I have made them inherit from@unchecked Sendable
. This change should help reduce the number of unnecessary compiler warnings.Examples
Previews