Sign in to follow this  
ALRAZ

2.24.0 Cannot instantiate a class outside of it's namespace

Recommended Posts

ALRAZ    150
Hello, I've been testing the 2.24.0 release with namespaces and I think i found a bug.

Say we have the following script code:

[CODE]
namespace TestNamespace
{
class MyHappyClass
{
MyHappyClass ()
{
}

void DoSomething ()
{
//Actually should be called: DoNothing ()
}
}
}

void main ()
{
TestNamespace::MyHappyClass ClassInstance;

ClassInstance.DoSomething ();
}[/CODE]


We get the following error:
[CODE]
test.as (17, 1) : INFO : Compiling void main()
test.as (19, 17) : ERR : Identifier 'MyHappyClass' is not a data type
test.as (0, 0) : ERR : Script failed to build
[/CODE]


Even if I remove the "TestNamespace::" from the ClassInstance declaration, the compiling error persists [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]

Share this post


Link to post
Share on other sites
ALRAZ    150
Hey Andreas, I've tried with version 2.24.0a (Which by the way is not linked in the main page [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img] ), and I can tell you that, at least under a simple example, the bug is fixed.

BUT!
I'm affraid I found another similar bug [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]

If you try to inherit from a class that's inside a namespace from OUTSIDE of that namespace, you get a compiler error.
Example code:
[code]

namespace Test
{
class FSM
{
}

}

class AdvancedFSM: Test::FSM
{
}

void main ()
{
AdvancedFSM Adv;
}
[/code]

We get the following output:
[code]

main.fss (9, 24) : ERR : Expected '{'
main.fss (0, 0) : ERR : Script failed to build
[/code]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this