[Issue 8074] template-mixin example contradicts text

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 20 09:12:51 PDT 2014


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


Vladimir Panteleev <thecybershadow at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow at gmail.com


--- Comment #8 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-03-20 18:12:45 EET ---
I noticed this behavior today:

///////// test.d ////////
template T()
{
    void foo(string s) {}
}

void foo() {}

mixin T;

void main()
{
    foo("Test");
}
/////////////////////////

This will not compile - the module-level foo hides the mixed-in one, which
essentially makes the mixin a noop.

Is this intentional? It makes it impossible to use mixins to generate
additional overloads for a function.

-- 
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