+/* class_is_arraycompatible ****************************************************
+
+ Checks if two array type descriptors are assignment compatible.
+
+ RETURN VALUE:
+ true .... target = desc is possible
+ false ... otherwise
+
+*******************************************************************************/
+
+bool class_is_arraycompatible(arraydescriptor *desc, arraydescriptor *target)
+{
+ if (desc == target)
+ return true;
+
+ if (desc->arraytype != target->arraytype)
+ return false;
+
+ if (desc->arraytype != ARRAYTYPE_OBJECT)
+ return true;
+
+ /* {both arrays are arrays of references} */
+
+ if (desc->dimension == target->dimension) {
+ if (!desc->elementvftbl)
+ return false;
+
+ /* an array which contains elements of interface types is
+ allowed to be casted to array of Object (JOWENN) */
+
+ if ((desc->elementvftbl->baseval < 0) &&
+ (target->elementvftbl->baseval == 1))
+ return true;
+
+ return class_isanysubclass(desc->elementvftbl->clazz,
+ target->elementvftbl->clazz);
+ }
+
+ if (desc->dimension < target->dimension)
+ return false;
+
+ /* {desc has higher dimension than target} */
+
+ return class_isanysubclass(pseudo_class_Arraystub,
+ target->elementvftbl->clazz);
+}
+
+