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);