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
Given
// sourcery: AutoMockable protocol SomeProtocol { static func thisIsOk() } extension SomeProtocol { static func thisIsDoesNotCompile() {} }
Generates:
class SomeProtocolMock: SomeProtocol { static func reset() { //MARK: - thisIsOk thisIsOkVoidCallsCount = 0 thisIsOkVoidClosure = nil //MARK: - thisIsDoesNotCompile thisIsDoesNotCompileVoidCallsCount = 0 // ❌ Cannot find 'thisIsDoesNotCompileVoidCallsCount' in scope thisIsDoesNotCompileVoidClosure = nil // ❌ Cannot find 'thisIsDoesNotCompileVoidClosure' in scope } //MARK: - thisIsOk static var thisIsOkVoidCallsCount = 0 static var thisIsOkVoidCalled: Bool { return thisIsOkVoidCallsCount > 0 } static var thisIsOkVoidClosure: (() -> Void)? static func thisIsOk() { thisIsOkVoidCallsCount += 1 thisIsOkVoidClosure?() } }
The text was updated successfully, but these errors were encountered:
AutoMockable: fix generating static reset func
10c7aa4
- don't generate invalid code (see krzysztofzablocki#1335) - use type's access level for generated reset() function
AutoMockable: fix generating static reset func (#1336)
33f948a
- don't generate invalid code (see #1335) - use type's access level for generated reset() function
Squashed commit of the following:
5a96740
commit 33f948a Author: MontakOleg <[email protected]> Date: Sat Jun 22 15:38:14 2024 +0300 AutoMockable: fix generating static reset func (#1336) - don't generate invalid code (see #1335) - use type's access level for generated reset() function commit 2f8fc64 Author: art-divin <[email protected]> Date: Wed Jun 19 18:58:34 2024 +0000 Update Docs commit 7153768 Author: Ruslan A <[email protected]> Date: Wed Jun 19 22:50:18 2024 +0400 Fix associatedtype generics (#1345) * Preliminary associatedtype support * Implemented associatedtype support with generic requirements * Fixed failing test * Squashed commit of the following: commit 9d01e6f Author: Ruslan A <[email protected]> Date: Fri Jun 14 20:06:41 2024 +0400 Improved concurrency support in SwiftTemplate caching (#1344) * Removed test code * Removed comment * Updated Linux classes * update internal boilerplate code. * Updated generated code * Removed warnings * Updated expected file * Updated expected file * Adjusted protocol type for Linux * Removed protocol composition due to Swift compiler crash under Linux
Successfully merging a pull request may close this issue.
Given
Generates:
The text was updated successfully, but these errors were encountered: