back2dos / tinkerbell

MIT License
83 stars 8 forks source link

@:forward generate with default args #59

Open MetaChrome opened 9 years ago

MetaChrome commented 9 years ago

It would appear that default args on the function that is being forwarded to are not declared in the generated wrapper function, resulting in the default arguments not being executed with, in the forwarded-to function. It would appear for Ints, 0 is sent instead of the default argument.

back2dos commented 9 years ago

I don't think there's much I can do about it. All I can really find out about the parameter is whether it is optional or not: http://api.haxe.org/haxe/macro/Type.html#TFun

However, if you set the type to Null<Int>, it should work (at the performance cost caused by Null<Int> that is). Or you will have to forward those particular functions by hand (and forwarding will then skip them).