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

--- Comment #9 from Max Samukha <maxsamukha@gmail.com> ---
(In reply to Max Samukha from comment #8)

> 
> What's the reason for this error:
> 

See it now. Never mind. All seems good.

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

--- Comment #10 from Max Samukha <maxsamukha@gmail.com> ---
(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?

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

--- Comment #11 from Max Samukha <maxsamukha@gmail.com> ---
(In reply to Max Samukha from comment #10)

> void foo(U, T = int)(T a = T.init)
> {
> }
> 
> void main()
> {
>     foo!bool(0);
>     foo!bool("x");
> }
> 
Error: function `foo` is not callable using argument types `(string)`

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

Max Samukha <maxsamukha@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=24831

--
1 2
Next ›   Last »