1-- { dg-do compile }
2
3with Discr16_G;
4with Discr16_Cont; use Discr16_Cont;
5
6procedure Discr16 is
7
8  generic
9    type T is (<>);
10  function MAX_ADD_G(X : T; I : INTEGER) return T;
11
12  function MAX_ADD_G(X : T; I : INTEGER) return T is
13  begin
14    return T'val(T'pos(X) + LONG_INTEGER(I));
15  end;
16
17  function MAX_ADD is new MAX_ADD_G(ES6A);
18
19  package P is new Discr16_G(ES6A, MAX_ADD);
20
21begin
22  null;
23end;
24