Default arguments are faked via an extra function ...
# announcements
k
Default arguments are faked via an extra function or constructor with an extra
Int
as the first argument that's basically a bitset of parameters that were actually passed.
e
weird, I'd have automatically created another constructor.. anyway, I just done it manually and it works, thanks
k
That gets out of hand quickly if you have a couple of default parameters, and it doesn't work at all when they overlap.
It looks like for functions the name of the synthetic function has
$default
appended so it doesn't conflict, but for constructors that's not possible.
e
indeed
k
Maybe they could have gone with a factory function but that probably complicates reflection a lot.
e
yeah, I guess so