-
Notifications
You must be signed in to change notification settings - Fork 85
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
Compilation fix for a mock where the return type of a closure is an opaque type #259
Compilation fix for a mock where the return type of a closure is an opaque type #259
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this implementation would work well with the following code?🤔
protocol P {
func f(_: () -> (MyAwesomeType))
}
Hello, I am only replacing the word These other examples work well:
The generated mocks are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've confirmed that MyAwesomeType
changes to MyAweanyType
.
It seems sufficient to just change the replacement logic to s/some /any /g
.
oh right, sorry I misunderstood you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe work with most codes. Thanks!
Sorry I forgot launch workflow. |
The following code:
produces this mock:
causing the compilation error:
'some' cannot appear in parameter position in result type '((@autoclosure @escaping () -> (some Error)) -> ())?'
This pr fixes the variable
registerHandler
by generating the following mock: