On Friday, 16 March 2012 at 09:12:57 UTC, F i L wrote:
Alright I give up dammit! How do you use opCall() to make a.cool() work?

How would it be possible, the type of the delegate can't be typechecked at the call-site, because the type info is lost in the variant. And you can't exhaustively test for all function types in the opDispatch getter. opDispatch would have to store the names and types internally at compile-time, which isn't possible. But even then it would have to be guaranteed that all setter calls are evaluated before the getter calls are checked. Maybe one could manually store the type info in a special struct together with the delegate and then cast it to that type in the opDispatch getter.

Reply via email to