[Issue 12249] New: Variadic template argument deduction fails

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 25 03:23:18 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12249

           Summary: Variadic template argument deduction fails
           Product: D
           Version: D1
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Keywords: industry
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: mathias.baumann at sociomantic.com


--- Comment #0 from Mathias Baumann <mathias.baumann at sociomantic.com> 2014-02-25 03:23:16 PST ---
The following code fails:
----------
void foo(int x, T...)(T args)
{
    pragma(msg, T);
}

void main()
{
    foo!(42)(1, 2, 3);
}
----------

with 
-----
()
/d451/f334.d(8): Error: function f334.foo!(42).foo (() args) does not match
parameter types (int,int,int)
/d451/f334.d(8): Error: expected 0 arguments, not 3 for non-variadic function
type void(() args)
-----

See also:
http://dpaste.dzfl.pl/12257a1a3c11

It works in D2:
http://dpaste.dzfl.pl/fb44d9278d44

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list