HiddenFuncError for qualified mixins

Michael Coupland mcoupland at gmail.com
Fri Apr 4 22:12:03 PDT 2008


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!
	}
};


More information about the Digitalmars-d-learn mailing list