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
Computed properties that return Self also return Self in the mock.
Self
/// @mockable protocol FooRepository { static var shared: Self { get } }
I would like the mock class return.
final class FooRepositoryMock: FooRepository { init() { } static private(set) var sharedSetCallCount = 0 - static private var _shared: Self! { didSet { sharedSetCallCount += 1 } } - static var shared: Self { + static private var _shared: FooRepositoryMock! { didSet { sharedSetCallCount += 1 } } + static var shared: FooRepositoryMock { get { return _shared } set { _shared = newValue } } }
The text was updated successfully, but these errors were encountered:
If it were Self, would there be any problems?
Sorry, something went wrong.
@sidepelican Mock causes a compile error.
❌ .../OutputMocks.swift:99:99: stored property cannot have covariant 'Self' type static private var _shared: Self! { didSet { sharedSetCallCount += 1 } } ^
❌ .../OutputMocks.swift:99:99: mutable property cannot have covariant 'Self' type public static var shared: Self { ^
No branches or pull requests
Computed properties that return
Self
also returnSelf
in the mock.I would like the mock class return.
Reference
Version
The text was updated successfully, but these errors were encountered: