Ada generics are way over my head, but I think that your only problem is that you have defined the wrong type or bounds for the array index somewhere.
Running a little test with different index types in definition and declaration for a generic function, causes a similar error message from gnat-ada95:
h.adb:13:42: index types of actual do not match those of formal "arT"
h.adb:13:42: instantiation abandoned
Code used:
Code:
function h return integer is
subtype r is natural range 1..20;
generic
type item is (<>);
type arT is array(r) of item;
function print(x:in arT) return string;
function print(x:arT) return string is
begin
return "nothing";
end print;
type tmp is array(natural range 1..21) of character;
function f is new print (character,tmp);
begin
return 0;
end h;
Looks like this is it
--------
(If anyone has a clue about this, why, btw, can't I just use:
type arT is array(natural range 1..20) of item;
This gives me an error
(error is p.adb:5:25: only a subtype mark is allowed in a formal)
but would be much simpler, just like substituting the type definition for tmp in the "..new print.." declaration somewhere.)