https://issues.dlang.org/show_bug.cgi?id=19057

--- Comment #14 from Jonathan M Davis <issues.dl...@jmdavisprog.com> ---
The current behavior works well with default arguments, because then they never
get accidentally matched, whereas IFTI is allowed to match arguments against
them, then it becomes trivial to match them accidentally, and if that were the
case, I'd argue strongly that putting default arguments on parameters that come
after variadic parameters was too error-prone for it to make any sense. At
least in the case where there are no default arguments, you always have to
provide the arguments, so it's expected. But once you have default arguments,
those arguments are no longer expected, and it becomes trivial to think that
you're passing an argument that matches the variadic parameters but ends up
matching at least one of the parameters after the variadic parameters. The
behavior would be fatal for any attempt at something like logging because of
how much would accidentally match against __FILE__, but any case where you have
parameters with default arguments following varidiac parameters would be very
error-prone unless the types involved were extremely unlikely to be passed to
the function. I fail to see why having the parameters with default arguments
matching with IFTI would ever be desirable. It's just too error-prone.

--

Reply via email to