MakeAWishFoundation / SwiftyMocky

Framework for automatic mock generation. Adds a set of handy methods, simplifying testing. One of the best and most complete solutions, including generics support and much more.
MIT License
1.04k stars 106 forks source link

'some' keyword in function signature does not seem supported #327

Open JadQuincyJohn opened 2 years ago

JadQuincyJohn commented 2 years ago

Overview

Generating a mock from a function with parameters containing the some keyword fails

Example

Steps to reproduce the issue

  1. Given a swift file containing this code
import Foundation

protocol AutoMockable {}

protocol CustomerProtocol {
    var name: String { get }
    var email: String { get }
}

protocol CustomerRepositoryProtocol: AutoMockable {
    func send(customer: some CustomerProtocol) -> Result<CustomerRepositorySuccess, CustomerRepositoryError>
}

struct CustomerRepositorySuccess {}

enum CustomerRepositoryError: Error {
    case remoteFailure(String)
}
  1. Launch the mock generation using ./Pods/SwiftyMocky/bin/swiftymocky generate

  2. The resulting Mock.generated file produces a file with errors

Screenshot 2022-10-13 at 14 02 56

Expected behavior

The generated Mock file should compile

Environment

SwiftyMocky version: 4.1.0 Xcode and Swift version: XCode 14.0 / Swift 5.7 Package manager: CocoaPods Unit testing framework: XCTest