[Issue 13807] New: inout(T)[] no longer matches string[]

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


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

          Issue ID: 13807
           Summary: inout(T)[] no longer matches string[]
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: thecybershadow at gmail.com

/////////////////// test.d //////////////////
inout(T) sample(T)(inout(T)[] arr)
{
    return arr[0];
}

void main()
{
    auto n = sample([7, 7, 7]);      // OK
    auto s = sample(["foo", "bar"]); // Error
}
/////////////////////////////////////////////

test.d(9): Error: template test.sample cannot deduce function from argument
types !()(string[]), candidates are:
test.d(1):        test.sample(T)(inout(T)[] arr)

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

--


More information about the Digitalmars-d-bugs mailing list