🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

There seem to be cases where `implicit handle` does not work well.

Started by
2 comments, last by WitchLord 6 years, 2 months ago

Although it is a report on experimental support,


engine->SetEngineProperty(asEP_ALLOW_IMPLICIT_HANDLE_TYPES, 1);

First, set asEP_ALLOW_IMPLICIT_HANDLE_TYPES to true.


class@ A
{
  A(A@ a) {  }
}
class@ B : A
{
  B(A@ a) { super(a); }
}
class@ C : B
{
  C(A@ a) { super(a); }
}

int main()
{
  auto a = A(null);
  auto c = C(a);
  auto b = B(c);
  return 0;
}

Then prepare the above code and execute asrun, an error will be output.


$ ./asrun.exe script2.as
script2.as (18, 1) : INFO : Compiling int main()
script2.as (22, 8) : ERR  : No default constructor for object of type 'B'.
script2.as (22, 8) : ERR  : No appropriate opAssign method found in 'B' for value assignment
script2.as (0, 0) : ERR  : Script failed to build

If you change as follows, it works normally.


auto b = B(@c);

Alternatively,


B@ b = B(c);

 

Advertisement

Thanks for the report. I'll look into this.

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

I've fixed this in revision 2497.

Regards,
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

This topic is closed to new replies.

Advertisement