Jump to content
  • Advertisement
Sign in to follow this  

const not handled for object handles ?

This topic is 3964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, If i write the following code in angelscript :
class CTest
	int m_Int;

	void SetInt(int iInt)
		m_Int = iInt;

const CTest Test;
const CTest@ TestHandle = @Test;

TestHandle.SetInt(1);    // compiler incorrectly thinks this line is OK ???
Test.SetInt(1);          // compiler will correctly give an error on this line

Then the angelscript compiler gives correctly an error on "Test.SetInt(1);" stating that a matching const function cannot be found. It does not give an error however on the line "TestHandle.SetInt(1);" even though that one is also declared const and the handle references a const object. The same happens if functions declared in the C++ code return const handles to objects. Any non const functions called on those const object handles will not generate a compiler error. Is this a bug in the angelscript compiler or am I using handles wrongly ??? Thanks in advance. By The Way, Angelscript is Great !!

Share this post

Link to post
Share on other sites
This looks like a bug in AngelScript. I'll give it a closer look as soon as I can. Thanks for the clear explanation.


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!