Ada has a few complexities when it comes to array handling. Currently
these are all handled in Ada-specific code -- but unfortunately that
means they aren't really accessible to Python.
This patch changes the Python code to defer to Ada when given an Ada
array. In order to make this work, one spot in ada-lang.c had to be
updated to set the "GNAT-specific" flag on an array type.
The test case for this will come in a later patch.
longest_to_int (value_as_long (low)),
longest_to_int (value_as_long (high)));
elt_type = create_array_type (alloc, elt_type, range_type);
+ INIT_GNAT_SPECIFIC (elt_type);
if (ada_is_unconstrained_packed_array_type (arr->type ()))
{
#include "expression.h"
#include "cp-abi.h"
#include "python.h"
+#include "ada-lang.h"
#include "python-internal.h"
if (type->code () != TYPE_CODE_ARRAY
&& type->code () != TYPE_CODE_PTR)
error (_("Cannot subscript requested type."));
+ else if (ADA_TYPE_P (type))
+ res_val = ada_value_subscript (tmp, 1, &idx);
else
res_val = value_subscript (tmp, value_as_long (idx));
}