[Issue 2417] protected base member is not available via base hanlde in a derived class if it is defined in a separate module

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 18 08:43:42 PDT 2008


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





------- Comment #8 from schveiguy at yahoo.com  2008-10-18 10:43 -------
(In reply to comment #7)
> clone does not need a different behavior, this should work:
> 
> class C
> {
>    protected int x;
>    C clone()
>    {
>       auto ret = new C;
>       ret.x = x;
>       return ret;
>    }
> }
> 
> I don't see the problem.
> 

err.. that was a bad example, add this:

class C : D
{
  protected int y;
  D clone()
  {
    auto ret = new D;
    ret.x = x;
    ret.y = y;
  }
}


-- 



More information about the Digitalmars-d-bugs mailing list