[Issue 13223] New: Cannot deduce argument for array template parameters

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 29 01:32:46 PDT 2014


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

          Issue ID: 13223
           Summary: Cannot deduce argument for array template parameters
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: dragoscarp at gmail.com

Following code works with 2.065:

T[] foo(T)(T[] a1, T[] a2)
{
    return a1 ~ a2;
}

void main()
{
    int[] a = [1, 2];
    assert(foo(a, []) == [1, 2]);
}

With 2.066.0-b6 it generates compile error:

template_deduction.d(9): Error: template template_deduction.foo cannot deduce
function from argument types !()(int[], void[]), candidates are:
template_deduction.d(1):        template_deduction.foo(T)(T[] a1, T[] a2)

--


More information about the Digitalmars-d-bugs mailing list