https://d.puremagic.com/issues/show_bug.cgi?id=11873
Summary: function templates conflict with aliases Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: monarchdo...@gmail.com --- Comment #0 from monarchdo...@gmail.com 2014-01-05 13:34:13 PST --- Apparently, this is according to spec, but I think it should be legal. Simple functions? No problem: //---- void foo(); void bar(int); alias foo = bar; void main() { foo(); foo(5); } //---- 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. The above code is trivial, but a real world scenario where this can happen, is when a module wants to publicly import a named template function overload: A.d //---- module a; foo(int); //Special "int" overload //---- B.d //---- module b; foo()(); //Standard 0-arg signature; public import A : foo; //re-use "int" //---- Because of this, -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------