Matejkob/swift-spyable

`mutating` functions cause a compiler error

davbeck opened this issue · 1 comments

If a spyable protocol has a mutating function, the spy gets generated with the same modifier, but that's invalid for a class.

Example:

@Spyable
public protocol Client {
  mutating func logout()
}

Produces:

class ClientSpy: Example {
	 mutating func logout() {
	    logoutCallsCount += 1
	    logoutClosure?()
	}
}

Dropping mutating from the spy should be all that's needed since all class methods are mutating.

Thanks so much for your contribution! ❤️ Would you like to try to make a PR for this issue?