[Issue 19057] 2.079 changelog variadic template and default arguments
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jul 5 21:41:24 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19057
--- Comment #8 from Steven Schveighoffer <schveiguy at yahoo.com> ---
I think we need to find a way to change this behavior, and soon. As it stands
now, it doesn't make sense, as it's only useful in the __FILE__ and __LINE__
context. It could easily be generalized to fit all contexts, even in a way
where the original behavior is valid. I'd flag this as a regression if it were
up to me.
The change that allows default parameters to work is reasonable. The change
that makes them NEVER match IFTI-passed arguments is very bad and not
intuitive.
I'd absolutely expect this to work like anyone would think it should:
Exception genErr(A...)(A args, string file = __FILE__, size_t line = __LINE__)
Exception genSpecificError(string file = __FILE__, size_t line = __LINE)
{
return genErr(1, 2, 3, file, line);
}
And the workaround is NOT pleasant.
--
More information about the Digitalmars-d-bugs
mailing list