www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13223] New: Cannot deduce argument for array template


          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 puremagic.com
          Reporter: dragoscarp 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)

Jul 29 2014