[Issue 11873] function templates conflict with aliases

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 5 13:37:52 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11873



--- Comment #1 from monarchdodra at gmail.com 2014-01-05 13:37:52 PST ---
(In reply to comment #0)
> Templates? Problem:
> //----
> void foo()(); //Template here
> void bar(int);
> 
> alias foo = bar;
> 
> void main()
> {
>     foo();
>     foo(5);
> }
> //----
> main.d(4): Error: alias main.foo conflicts with template main.foo()() at
> main.d(1)
> //----
> 
> I think there should not be such a conflict. There is no reason for the alias
> not to work.

Just to be clear, I think this should be legal, as there is absolutly no
conflict between the original symbol, and the alias anyways.

Perfectly legal:
//----
void foo()();
void foo(int);

void main()
{
    foo();
    foo(5);
}
//----

If that works, why does the alias create a conflict?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list