• Advertisement
Sign in to follow this  

const not handled for object handles ?

This topic is 3785 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
Sign in to follow this  

  • Advertisement