[Issue 13811] New: Cannot deduce function from argument types with varargs

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Dec 2 09:25:42 PST 2014


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

          Issue ID: 13811
           Summary: Cannot deduce function from argument types with
                    varargs
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: doob at me.com

This code worked in 2.066.0 but fails to compile in 2.066.1

void remove (T) (T[] arr, T[] elements ...) { }
void remove (Range, Index ...) (Range range, Index indexes) { }

void main ()
{
    string[] a;
    a.remove(3);
}

The error message is:

main.d(12): Error: template main.remove cannot deduce function from argument
types !()(string[], int), candidates are:
main.d(6):        main.remove(T)(T[] arr, T[] elements...)
main.d(7):        main.remove(Range, Index...)(Range range, Index indexes)

--


More information about the Digitalmars-d-bugs mailing list