Advertisement

Defining a method with the class name

Started by June 15, 2010 10:38 AM
1 comment, last by WitchLord 14 years, 4 months ago
Hi,

One of my students recently hit a problem with Angelscript using a script like this:

class MyTest{   void MyTest()  // the "void" here is a mistake, but the method is still valid   {      print("I am not a constructor");   }}void main(){    MyTest myTest;    myTest.MyTest(); // legal call prints the text}

Is it intended to support methods looking like a constructor? I have never tried that in C++. At least a warning in this case might be appropriate.
What do you think?

xad
This shouldn't be allowed. It is a bug in the compiler.

I'll have this fixed as soon as possible.

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
This has been fixed in revision 630. Thanks.

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

This topic is closed to new replies.

Advertisement