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

--- Comment #8 from Max Samukha <[email protected]> ---
(In reply to Dennis from comment #7)


> 
> This gives an error "foo called with argument types `(string)` matches both
> ...", showing that default arguments are not considered for overload
> resolution.

Thank you for the explanation! The current semantics makes sense to me now. The
fix that strips default arguments doesn't seem the right way to go.

What's the reason for this error:

void foo(T)(T a = T.init); // Error: undefined identifier `T`

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

?

It works with a default argument for the type parameter:

void foo(T = int)(T a = T.init); // ok

I'd be absolutely happy if this were fixed.

--

Reply via email to