Bug 19888 – default parameters in templates with tuple parameters+defaults are thrown away
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-05-21T04:14:52Z
Last change time
2019-05-21T12:53:32Z
Keywords
pull
Assigned to
No Owner
Creator
elpenguino+D
Comments
Comment #0 by elpenguino+D — 2019-05-21T04:14:52Z
This example fails to compile on all known DMD versions.
```
unittest {
assert(func(1,0) == 1);
assert(func(1) == 1); //compile error
assert(func2() == 0);
}
template AliasSeq(TList...)
{
alias AliasSeq = TList;
}
T func(T)(T value, AliasSeq!(int) params = AliasSeq!(0))
{
return value;
}
int func2(AliasSeq!(int) params = AliasSeq!(0))
{
return 0;
}
```
Comment #1 by dlang-bot — 2019-05-21T12:08:09Z
@RazvanN7 created dlang/dmd pull request #9827 "Fix Issue 19888 - default parameters in templates with tuple parameters+defaults are thrown away" fixing this issue:
- Fix Issue 19888 - default parameters in templates with tuple parameters+defaults are thrown away
https://github.com/dlang/dmd/pull/9827
Comment #2 by dlang-bot — 2019-05-21T12:53:32Z
dlang/dmd pull request #9827 "Fix Issue 19888 - default parameters in templates with tuple parameters+defaults are thrown away" was merged into stable:
- 15f4f29395e929a410cb173648651f727430ca50 by RazvanN7:
Fix Issue 19888 - default parameters in templates with tuple parameters+defaults are thrown away
https://github.com/dlang/dmd/pull/9827