Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JadQuincyJohn opened this issue Oct 13, 2022 · 0 comments
Open

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

JadQuincyJohn opened this issue Oct 13, 2022 · 0 comments

Comments

@JadQuincyJohn
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant