Cuckoo
Cuckoo copied to clipboard
Generated code for a protocol which requires a generic initializer cause a compiler error
protocol SomeProtocol {
init<T>(t: T)
}
The code generated by the protocol above will have an initializer like below which cause a compiler error.
required init(t: T) {
}
It looks like the type placeholder is missing when generating for an initializer.
Hi, @myihsan. This seems like a forgotten generic parameters string in the mock template, should be a fairly easy fix. Though the tests should have contained a generic init, I must have overlooked this.
Hey, I fixed this issue in the fix/protocol-generic-init
, though I found out that generic methods in protocols aren't supported either. I'm not sure if it's possible to add that functionality with the current way it works, so I'll keep you posted in case I think of something and have the time to implement it.