www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - HiddenFuncError for qualified mixins

Hi,

I was wondering why the call to BaseHelper.Func() below results in a 
HiddenFuncError (D 2.0); it seems to me that it should be legal to call 
an overriden function if it's specified in this way.

If this is not The Way to Do It In D, is there a "better" way of 
accomplishing this behavior with mixins without having to resort to 
inheritance?

Thanks!

--------------------------

template HelperMixin()
{
	void Func()
	{
		//
		// base helper functionality
		//
	}
};

class Class
{
	mixin HelperMixin BaseHelper;

	void Func()
	{
		//
		// some extra functionality
		//

		BaseHelper.Func(); // results in a HiddenFuncError!
	}
};
Apr 04 2008