We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Overload inside #if macro produces same handlers that results compile error.
#if
/// @mockable protocol PresentableListener: AnyObject { #if DEBUG func run(value: Int) func run(value: String) #endif func run2(value: Int) func run2(value: String) }
class PresentableListenerMock: PresentableListener { init() { } #if DEBUG private(set) var runCallCount = 0 var runHandler: ((Int) -> ())? func run(value: Int) { runCallCount += 1 if let runHandler = runHandler { runHandler(value) } } // not supporting overload private(set) var runCallCount = 0 var runHandler: ((String) -> ())? func run(value: String) { runCallCount += 1 if let runHandler = runHandler { runHandler(value) } } #endif private(set) var run2CallCount = 0 var run2Handler: ((Int) -> ())? func run2(value: Int) { run2CallCount += 1 if let run2Handler = run2Handler { run2Handler(value) } } // supporting overload private(set) var run2ValueCallCount = 0 var run2ValueHandler: ((String) -> ())? func run2(value: String) { run2ValueCallCount += 1 if let run2ValueHandler = run2ValueHandler { run2ValueHandler(value) } } }
mock vars for second func run(value:) inside if macro should be runValueCount and runValueHandler.
run(value:)
runValueCount
runValueHandler
The text was updated successfully, but these errors were encountered:
Note: #279 fixed above case but other bug is pointed out at #279 (review)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Overload inside
#if
macro produces same handlers that results compile error.mock vars for second func
run(value:)
inside if macro should berunValueCount
andrunValueHandler
.The text was updated successfully, but these errors were encountered: