Can't call base function if the function name is the same as a class name

Started by
2 comments, last by Miss 7 years, 1 month ago
Here's a simple example that demonstrates the problem. Note how there is a class Cat, Foo, and Bar. There is no class named "Dog".
class Cat
{
}

class Foo
{
	int Cat()
	{
		return 0;
	}

	int Dog()
	{
		return 0;
	}
}

class Bar : Foo
{
	int Cat() override
	{
		return Foo::Cat(); // ERROR: Identifier 'Cat' is not a data type in namespace 'Foo' or parent
	}

	int Dog() override
	{
		return Foo::Dog(); // OK
	}
}
Edit: I forgot to set the prefix of the thread to Bug. Sorry about that!
Advertisement

Thanks Ansjh!

I'll look into this and provide a fix for it as soon as I can.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I finally managed to fix this problem. You can get the fix in revision 2376.

Sorry for the delay.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

That's great! Thanks for letting me know :)

This topic is closed to new replies.

Advertisement