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

--- Comment #10 from Max Samukha <[email protected]> ---
(In reply to Max Samukha from comment #9)
> All seems good.

Unfortunately, no. This compiles ok:

void foo(T = int)(T a = T.init)
{
}

void main()
{
    foo();
    foo("x");
}


But if there's another template parameter, the compiler tries to reuse the
previous instantiation and fails:

void foo(U, T = int)(T a = T.init)
{
}

void main()
{
    foo!bool(0);
    foo!bool("x");
}

Is this a bug?

--

Reply via email to