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


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #3 from [EMAIL PROTECTED]  2008-12-09 05:13 -------
This is not a bug.

The mixin establishes its own scope that is nested inside B's scope. If there
is no print in B's scope, it will look in the mixin. If there is a print in B's
scope, it will not look in the mixin.

This works exactly the same as imports and symbols at module scope.

The solution is to bring the desired members of mixtem up into B's scope. An
alias will accomplish this, so rewriting B as:

class B:A,mix 
{
        alias A.print print;    
        mixin mixtem M;        // give scope the name 'M'
        alias M.print print;   // and bring M's print into B's scope
        void pr() 
        { 
                super.print(); 
                super.print(18); 
                print("OK");   // this should call mixin member func
                writefln("B"); 
        } 
}

should work.


-- 

Reply via email to