I'm trying to merge the contents of two dictionaries as follows:
dictionary d1 = {{'1','1'}};
dictionary d2 = {{'2','2'}};
array<string>@ keys = d2.getKeys();
for (uint i = 0; i < keys.length(); ++i)
{
// Try 1:
// No appropriate opAssign method found in 'dictionaryValue' for value assignment
// Previous error occurred while attempting to create a temporary copy of object
d1[keys[i]] = d2[keys[i]];
// Try 2:
// Assert "tempVariables.exists(offset)" at as_compiler.cpp:4895, asCCompiler::ReleaseTemporaryVariable()
string key = keys[i];
d1[key] = d2[key];
}
I would hope that approach 1 can work in the future, but approach 2 causes an assert with the following backtrace:
#7 0x09157dd3 in __assert_fail (__assertion=0x9607d55 "tempVariables.Exists(offset)", __file=0x96061b4 "AngelScript/source/as_compiler.cpp", __line=4895, __function=0x96094c0 "void asCCompiler::ReleaseTemporaryVariable(int, asCByteCode*)") at bld/Assert.cpp:46
#8 0x09108a30 in asCCompiler::ReleaseTemporaryVariable (this=0xbfbc3ad0, offset=14, bc=0x0) at AngelScript/source/as_compiler.cpp:4895
#9 0x091139ab in asCCompiler::CompileOverloadedDualOperator2 (this=0xbfbc3ad0, node=0xcc34154, methodName=0x95fde2f "opAssign", lctx=0xbfbc32c4, rctx=0xbfbc3368, ctx=0xbfbc3458, specificReturn=false, returnType=...) at AngelScript/source/as_compiler.cpp:11700
#10 0x09113f34 in asCCompiler::CompileOverloadedDualOperator (this=0xbfbc3ad0, node=0xcc34154, lctx=0xbfbc32c4, rctx=0xbfbc3368, ctx=0xbfbc3458, isHandle=false) at AngelScript/source/as_compiler.cpp:11602
#11 0x09105af0 in asCCompiler::DoAssignment (this=0xbfbc3ad0, ctx=0xbfbc3458, lctx=0xbfbc32c4, rctx=0xbfbc3368, lexpr=0xcc33e84, rexpr=0xcc34184, op=37, opNode=0xcc34154) at AngelScript/source/as_compiler.cpp:7504
#12 0x0911c7a7 in asCCompiler::CompileAssignment (this=0xbfbc3ad0, expr=0xcc33e54, ctx=0xbfbc3458) at AngelScript/source/as_compiler.cpp:7602
#13 0x0911d8d1 in asCCompiler::CompileExpressionStatement (this=0xbfbc3ad0, enode=0xcc33e24, bc=0xbfbc3590) at AngelScript/source/as_compiler.cpp:4309
#14 0x0912bd36 in asCCompiler::CompileStatementBlock (this=0xbfbc3ad0, block=0xcc25d64, ownVariableScope=true, hasReturn=0xbfbc3687, bc=0xbfbc37e0) at AngelScript/source/as_compiler.cpp:1121
#15 0x09129e54 in asCCompiler::CompileStatement (this=0xbfbc3ad0, statement=0xcc25d64, hasReturn=0xbfbc3687, bc=0xbfbc37e0) at AngelScript/source/as_compiler.cpp:3515
#16 0x0912ad69 in asCCompiler::CompileForStatement (this=0xbfbc3ad0, fnode=0xcc25674, bc=0xbfbc38b0) at AngelScript/source/as_compiler.cpp:4068
#17 0x0912bd36 in asCCompiler::CompileStatementBlock (this=0xbfbc3ad0, block=0xb47efdc, ownVariableScope=false, hasReturn=0xbfbc397f, bc=0xbfbc3980) at AngelScript/source/as_compiler.cpp:1121
#18 0x0912c0b3 in asCCompiler::CompileFunction (this=0xbfbc3ad0, builder=0xcc21d4c, script=0xcc31c54, parameterNames=..., func=0xb4c02bc, outFunc=0xcc20f9c, classDecl=0x0) at AngelScript/source/as_compiler.cpp:553
#19 0x090d7917 in asCBuilder::CompileFunctions (this=0xcc21d4c) at AngelScript/source/as_builder.cpp:835
#20 0x090e9f36 in asCBuilder::Build (this=0xcc21d4c) at AngelScript/source/as_builder.cpp:244
Am I doing anything wrong with the above syntax?
32-bit linux, rev 2030
Thank you!