Jump to content
  • Advertisement
Sign in to follow this  
saejox

Mixin in different section compile error

This topic is 2209 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 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.

Share this post


Link to post
Share on other sites
Advertisement
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!