Closed sonygod closed 11 years ago
This is currently not possible and I'm not sure I understand how this would actually look in practice.
Could you create a gist with a minimal example of what your input is (the type you forward to and the class that uses forwarding) and the final output that you want?
sorry for delay .. https://gist.github.com/sonygod/5129192
I am aware that you might want to go in that direction, but I see no sensible way to get this to work. What would the declaration of TestProxy look like? And how do you intend to make sure that the callback is in fact called? Are you using "forward to function"?
As an alternative, I would suggest you return some kind of future from the function, rather than passing additional arguments to it. Your example would then look like this:
test.dropItem(1000).handle(callBack.bind([1000]))
Would that work?
not work ,such like other tool google buff proto tool it's auto add additional arguments , also I can write other tool to implement that ,but i hopefully it's auto create in code use macro.
ok,i will try your suggestions ,thanks .
can @:forward could auto add other argument to method?
typedef ITest= {
}
and after @:forward
function say (a:Int, b:String,recall:Void->Void,args:Array):String;
Is that possible?