Bug 11548 – ParameterDefaultValueTuple fails to compile when passed in a function containing a parameter named "args".

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-18T23:00:00Z
Last change time
2015-06-09T01:31:14Z
Assigned to
nobody
Creator
opantm2+dbugs

Comments

Comment #0 by opantm2+dbugs — 2013-11-18T23:00:18Z
From what I can tell, the template seems to use the name of the arguments as part of a lambda, while declaring "args" itself. So when one of the parameters is named args, this creates a duplicate definition and fails to compile. Sample code: import std.traits; void foo(string[] args) { } void main() { alias T = ParameterDefaultValueTuple!foo; } Output: Ognjen:~$ rdmd test.d /Users/kapps/dev/dmd/phobos/std/traits.d(1093): Error: delegate std.traits.ParameterDefaultValueTuple!(foo).Get!(0LU).__lambda2 parameter __lambda2.args is already defined /Users/kapps/dev/dmd/phobos/std/traits.d(1122): Error: template instance std.traits.ParameterDefaultValueTuple!(foo).Get!(0LU) error instantiating /Users/kapps/dev/dmd/phobos/std/traits.d(1125): instantiated from here: Impl!() test.d(20): instantiated from here: ParameterDefaultValueTuple!(foo) /Users/kapps/dev/dmd/phobos/std/traits.d(1125): Error: template instance std.traits.ParameterDefaultValueTuple!(foo).Impl!() error instantiating test.d(20): instantiated from here: ParameterDefaultValueTuple!(foo) test.d(20): Error: template instance std.traits.ParameterDefaultValueTuple!(foo) error instantiating
Comment #1 by pro.mathias.lang — 2015-03-28T19:34:19Z
Fixed in Phobos P.R. #2624