Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now
- - - - -

Mixin in different section compile error

4: Adsense

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
2 replies to this topic

#1 saejox   Members   

714
Like
0Likes
Like

Posted 28 September 2012 - 12:28 PM

Hi,

If a mixin and a class are in different script sections it causes a compile error.
compile error is non-nonsensical. probably a parsing error.

here is the minimal setup for the error
Test1.as
class Base : MChild
{

};

Test2.as
mixin class MChild
{
  // error occurs only if one or more functions exists in mixin.
  void SomeFunc()
  {

  }
};

c++ , simple load from file
	 engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
	 engine->SetMessageCallback(asFUNCTION(MessageCallback), 0, asCALL_CDECL);
	 mod = engine->GetModule("TEST", asEGMFlags::asGM_ALWAYS_CREATE);
	 string f;
	 LoadScriptFile("Test1.as", f);
	 mod->AddScriptSection("Test1.as", f.c_str());
	 f  = "";
	 LoadScriptFile("Test2.as", f);
	 mod->AddScriptSection("Test2.as", f.c_str());
	 mod->Build();

error does not occur if both are in same section.
error is : Test1.as (5, 12) ERR: Expected '{'

Thanks.

#2 Andreas Jonsson   Moderators   

4628
Like
1Likes
Like

Posted 03 October 2012 - 07:14 PM

Thanks. This problem has already been reported by another user. I'll have it fixed asap.
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   

4628
Like
1Likes
Like

Posted 06 October 2012 - 09:15 AM

This has been fixed in revision 1423.

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




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.