class x is hidden by y

Benjamin Thaut code at
Wed Oct 6 23:43:12 PDT 2010

For the following code in D 2.0 using dmd 2.049:

import std.stdio;

abstract class foo {
	void WrongType(){
		assert(0,"Using wrong type");
	void Update(int value){WrongType();}
 	void Update(float value){WrongType();}

class blup : public foo {
	public override void Update(int value){

void main(string[] argv){
	foo s = new blup();

When compiling with -w option I get the following warning:
test.d(25): Error: class test.blup value) is hidden by blup

When compiling without the -w option I get the following runtime error:
core.exception.HiddenFuncError: Hidden method called for test.blup

So I don't get why void Update(float value) is hidden. I come from C++ so
please show me my mistake.

Kind Regards
Benjamin Thaut

More information about the Digitalmars-d-learn mailing list