[INTERPRETER]

* NEW: [...] now returns an object array if its two arguments are objects 
  from different classes.


git-svn-id: svn://localhost/gambas/trunk@1788 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2009-01-05 11:53:53 +00:00
parent da334a98dd
commit 450b87b792
2 changed files with 13 additions and 4 deletions

View file

@ -1547,7 +1547,7 @@ void GB_ArrayNew(GB_ARRAY *array, uint type, int size)
np = 0;
}
if (type > T_OBJECT)
if (TYPE_is_pure_object(type))
class = CLASS_get_array_class((CLASS *)type);
else
{

View file

@ -305,15 +305,24 @@ static TYPE conv_type(TYPE type)
void SUBR_array(void)
{
TYPE type;
TYPE type, type2;
int i;
GB_ARRAY array;
SUBR_ENTER();
type = conv_type(PARAM[0].type);
if (NPARAM >= 2 && conv_type(PARAM[1].type) != type)
type = T_VARIANT;
if (NPARAM >= 2)
{
type2 = conv_type(PARAM[1].type);
if (type != type2)
{
if (TYPE_is_object(type) && TYPE_is_object(type2))
type = T_OBJECT;
else
type = T_VARIANT;
}
}
GB_ArrayNew(&array, type, NPARAM);