The following way of getting the number of parameters of an anon function at runtime works in JS,
but not on Eval or Cpp. (Haven’t tried other platforms.)
I there any other runtime way, or do I have to go the macro route?
function main() {
var callback = (v:Int, a:String) -> {
trace(v);
};
var length:Null<Int> = Reflect.getProperty(callback, 'length');
trace(length); // Works in JS, but gives null in Eval, CPP...
}