www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13378] New: Wrong failure of template value parameter

https://issues.dlang.org/show_bug.cgi?id=13378

          Issue ID: 13378
           Summary: Wrong failure of template value parameter deduction in
                    IFTI
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

From: http://forum.dlang.org/thread/bduqdtfxjmlswksytbvh forum.dlang.org

This code works with 2.065, but fails with 2.066.

------
struct Vec(size_t n, T, string as)
{
    T[n] data;
}

void doSome(size_t n, T, string as)(Vec!(n,T,as) v) {}

void main()
{
    auto v = Vec!(3, float, "xyz")([1,2,3]);
    doSome(v);
}
------

test.d(6): Error: template test.doSome(uint N, T, string AS)(Vec!(N, T, AS) v)
specialization not allowed for deduced parameter AS

Introduced in: https://github.com/D-Programming-Language/dmd/pull/3536

--
Aug 25 2014