Basic reproducer:
/// @mockable
protocol Tester {
var testDictionary: [String: () -> String] { get }
}
Produces:
class TesterMock: Tester {
init() { }
init(testDictionary: @escaping [String: () -> String]) {
self._testDictionary = testDictionary
}
private var _testDictionary: ([String: () -> String])!
var testDictionary: [String: () -> String] {
get { return _testDictionary }
set { _testDictionary = newValue }
}
}
The @escaping in the init causes a compiler error due to it be associated with a dictionary rather than a function.