Maybe a way to split the difference is to bring back the closure literals as anonymous structs idea. Then you could declare a protocol with a generic callAsFunction
requirement, and a closure literal passed in some Protocol
or any Protocol
context would be able to be generic according to Protocol
's callAsFunction
signature.
10 Likes