www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - 2.079 semantic change needs to be marked in changelog

reply Johan Engelen <j j.nl> writes:
The changelog of 2.079 says:
"
3. Function parameters with default values are now allowed after 
variadic template parameters
Function parameters with default values are now allowed after 
variadic template parameters and when IFTI is used, always take 
their default values.
...
"

However, parameters with default values were already allowed 
after variadic template parameters. And the 2.079-change of 
behavior results in compile errors (in the best case), but may 
also lead to bad runtime behavior of previously working code. I 
hope the change was made knowingly that it was a semantic change, 
instead of an addition to the semantics...

Simple test case:
```
import std.stdio;

void bar(Args...)(Args _args, int timeout = 0) {
     pragma(msg, typeof(_args));
     writeln(_args, timeout);
}

void main() {
     bar("a", "b", 2); // used to print "ab2", but since 2.079 
prints "ab20"
}
```

Semantic changes like this need to be very clearly marked in the 
changelog. Updating the compiler on a commercial codebase is 
already enough of an adventure, no need to add extra 
uncertainties.

Please fix the changelog.
Thanks,
   Johan
Jul 02 2018
parent reply Walter Bright <newshound2 digitalmars.com> writes:
Please post bug reports (including documentation problems) on bugzilla!
Jul 02 2018
parent Johan Engelen <j j.nl> writes:
On Tuesday, 3 July 2018 at 01:07:53 UTC, Walter Bright wrote:
 Please post bug reports (including documentation problems) on 
 bugzilla!
https://issues.dlang.org/show_bug.cgi?id=19057
Jul 05 2018