Advertisement

Fully qualified namespace when calling base class implementation

Started by November 11, 2014 07:08 PM
2 comments, last by iraxef 10 years ago

namespace ns
{
    abstract class Base
    {
        void Setup() { print("Base::Setup()"); }
    }

    class Derived : ns::Base
    {
        void Setup()
        {
            ns::Base::Setup(); // "Namespace 'ns::Base' doesn't exist"
            print("Derived::Setup()");
        }
    }
}

Changing the line above to just Base::Setup() works.

Thanks. I'll have it fixed.

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

Advertisement

I've fixed this in revision 2053

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

Here's a possibly related scenario:


namespace ns
{
    namespace __ns
    {
        const string FOO = 'bar';
    }

    void DoStuff ( )
    {
        // this works
        print( ns::__ns::FOO );

        // compiler error: "Unknown scope '__ns'"
        print( __ns::FOO );
    }
}

This topic is closed to new replies.

Advertisement