Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

2.24.0 Cannot instantiate a class outside of it's namespace


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 alraz   Members   -  Reputation: 150

Like
0Likes
Like

Posted 25 June 2012 - 03:37 PM

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:

namespace TestNamespace
{
	class MyHappyClass
	{
		MyHappyClass ()
		{
		}

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

void main ()
{
	TestNamespace::MyHappyClass ClassInstance;

	ClassInstance.DoSomething ();
}


We get the following error:
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


Even if I remove the "TestNamespace::" from the ClassInstance declaration, the compiling error persists Posted Image
format c: /q

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3226

Like
0Likes
Like

Posted 25 June 2012 - 04:23 PM

I'll look into it.

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

#3 Andreas Jonsson   Moderators   -  Reputation: 3226

Like
1Likes
Like

Posted 26 June 2012 - 05:18 PM

I've fixed this bug in revision 1355.

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

#4 alraz   Members   -  Reputation: 150

Like
0Likes
Like

Posted 07 July 2012 - 02:08 PM

Hey Andreas, I've tried with version 2.24.0a (Which by the way is not linked in the main page Posted Image ), 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 Posted Image

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:

namespace Test
{
   class FSM
   {
   }

}

class AdvancedFSM: Test::FSM
{
}

void main ()
{
   AdvancedFSM Adv;
}

We get the following output:

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

format c: /q

#5 Andreas Jonsson   Moderators   -  Reputation: 3226

Like
0Likes
Like

Posted 08 July 2012 - 08:51 PM

Ah, the parser is not expecting the scope in the inheritance list. I'll have this corrected.
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

#6 Andreas Jonsson   Moderators   -  Reputation: 3226

Like
0Likes
Like

Posted 13 July 2012 - 05:52 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS