www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Overloading with base class.

I think this bug has been mentioned before but no simple example was  
posted:


class Base
{
	int foo() { return 0; }
}

class Derived: Base
{
	alias Base.foo foo; // Overload.
	
	void foo(int i) { }
	
	this()
	{
		foo(); // Line 14.
		foo(1); // Line 15.
	}
}


DMD v0.102 output:
test.d(14): need 'this' to access member foo
test.d(15): need 'this' to access member foo

The errors go away when using this.foo.
Oct 15 2004