This simple script triggers an assert during compilation of the script:
class TestClass
{
TestClass(array<int> arr)
{
this.arr = arr;
}
private array<int> arr;
}
void main()
{
TestClass @t = TestClass({});
}
The assert triggered when main is called is:
as_compiler.cpp:6474: asUINT asCCompiler::ImplicitConversion(asCExprContext *, const asCDataType &, asCScriptNode *, EImplicitConv, bool, bool):
Assertion `ctx->type.dataType.GetTokenType() != ttUnrecognizedToken || ctx->type.dataType.IsNullHandle() || ctx->IsAnonymousInitList()' failed.
The call stack shows that asCCompiler::ImplicitConversion is called from asCCompiler::CompileConstructCall at as_compiler.cpp:10935, and it's only called when the constructor has exactly one argument. Working around the issue by adding another argument to the constructor works just fine.