www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12249] New: Variadic template argument deduction fails

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 puremagic.com
        ReportedBy: mathias.baumann sociomantic.com


--- Comment #0 from Mathias Baumann <mathias.baumann 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: -------
Feb 25 2014