diff --git a/main/gbx/gbx_c_array.c b/main/gbx/gbx_c_array.c index 0613c3e25..1131f8608 100644 --- a/main/gbx/gbx_c_array.c +++ b/main/gbx/gbx_c_array.c @@ -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 { diff --git a/main/gbx/gbx_subr_misc.c b/main/gbx/gbx_subr_misc.c index 7491822a6..5123383a2 100644 --- a/main/gbx/gbx_subr_misc.c +++ b/main/gbx/gbx_subr_misc.c @@ -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);