as_objecttype.cpp(369):
// interface
int asCObjectType::GetSubTypeId(asUINT subtypeIndex) const
{
if( flags & asOBJ_TEMPLATE )
{
if( subtypeIndex >= templateSubTypes.GetLength() )
return asINVALID_ARG;
return engine->GetTypeIdFromDataType(templateSubTypes[subtypeIndex]);
}
// Only template types have sub types
return asERROR;
}
If the type is a specialization of a template, the asOBJ_TEMPLATE flag is not set
http://www.angelcode.com/angelscript/sdk/docs/manual/doc_adv_template.html#doc_adv_template_2
The templateSubTypes array does have elements though. Should the search through that array really be guarded by asOBJ_TEMPLATE?