[Issue 21258] New: tuple default parameters
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Sep 17 10:07:09 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21258
Issue ID: 21258
Summary: tuple default parameters
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: rmanth at gmail.com
alias AliasSeq(TList...) = TList;
int foo(AliasSeq!(int, int) args = AliasSeq!(3, 5))
{
return args[0] * args[1];
}
static assert(foo(2) == 10); // fails in 2.094.0-beta.1
static assert(foo() == 15); // fails in 2.094.0-beta.1
This used to give defaults of 3 and 5 but now gives defaults of 3 and 3 as of
2.094.0-beta.1. More generally any tuple parameter with tuple defaults just
tries to apply the first default value to all arguments.
Looks like it was broken by https://github.com/dlang/dmd/pull/11564
--
More information about the Digitalmars-d-bugs
mailing list