I have an application where I can not change the layout of a generic container, so I can't add an asITypeInfo* to it, which is also why I am using asIScriptGeneric.
In the asBEHAVE_DESTRUCT behavior, I can't get a valid subtype ID. For example, the following code returns the type “T” instead of the actual subtype.
asIScriptEngine* engine = gen->GetEngine();
int typeId = gen->GetObjectTypeId();
asITypeInfo* type = engine->GetTypeInfoById(typeId);
int subTypeId = type->GetSubTypeId();
asITypeInfo* subType = engine->GetTypeInfoById(subTypeId);
This works in other calls (eg. opAssign). Not sure about other behaviors.
In the case of asBEHAVE_DESTRUCT, typeId is 0x10000010 which is the container type itself with the subtype “T”, whereas in opAssign, typeId is 0x10000070 which is the specific container type with the proper subtype.
Is this a limitation in the script engine or a bug?