http://d.puremagic.com/issues/show_bug.cgi?id=8983


Walter Bright <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]


--- Comment #1 from Walter Bright <[email protected]> 2012-11-08 
14:54:35 PST ---
This actually isn't a bug. Inserting a template mixin creates a new nested
scope, and names not in that nested scope override the ones in it.

Your code can be made to work in two ways. But first we need to give a name to
the nested scope:

    mixin MixOverload;

becomes:

    mixin MixOverload nn;

Now, the mixin template names can be prefixed with nn:

    void test(int x)
    {
        nn.test(x, 1);    // call the overload defined in the mixin
    }

which works. Alternatively, the nested scope can be aliased into the current
scope with:

    alias nn.test test;

and now:

    void test(int x)
    {
        test(x, 1);    // call the overload defined in the mixin
    }

will work, as aa.test will be overloaded with test.

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

Reply via email to