[dmd-beta] dmd 2.064 beta 1

Jacob Carlborg doob at me.com
Sun Oct 13 04:06:48 PDT 2013


On 13 okt 2013, at 00:12, Walter Bright <walter at digitalmars.com> wrote:

> http://ftp.digitalmars.com/dmd2beta.zip


Tango fails to compile with this. Reduced test case:

inout(T[]) fromString8(T) (inout(char[]) s, T[] dst) // line 13
{
    return s;
}

void main ()
{
    char[] a;
    fromString8(a, a); // line 21
}

Error message:

main.d(21): Error: template main.fromString8 does not match any function template declaration. Candidates are:
main.d(13):        main.fromString8(T)(inout(char[]) s, T[] dst)
main.d(21): Error: template main.fromString8(T)(inout(char[]) s, T[] dst) cannot deduce template function from argument types !()(char[], char[])

It seems the compiler cannot infer the type of T. The following will compile:

fromString8!(char)(a, a)

And if "inout" is removed it will compile as  well.

-- 
/Jacob Carlborg



More information about the dmd-beta mailing list