{: test a compilation error occurs if parameter lists are not congruous }

{d-}
program e122( output );

type
   smallInt  = 1..10;
   arrayType =   array['1'..'9'] of integer;

var
   aci, aci1 : arrayType;
   aci2      : array['1'..'9'] of integer;

   aii : array[1..9] of integer;

procedure pp1(aa1, aa2 : arrayType);
begin
   write( aa1['1']:aa2['2'] );
end; { pp1 }

procedure pp2(aa1 : arrayType; aa2 : arrayType);
begin
   write( aa1['1']:aa2['2'] );
end; { pp2 }

procedure tt1(procedure pp(aa1, aa2 : arrayType));
begin
   pp(aci, aci1);
end; { tt1 }

procedure tt2(procedure pp(aa1 : arrayType; aa2 : arrayType));
begin
   pp(aci, aci1);
end; { tt2 }

procedure p1(aa1, aa2: array[lo..hi :char ] of integer);
begin
   aa1['1'] := 0;
end; { p1 }

procedure p2(aa1: array[lo1..hi1 :char ] of integer;
             aa2: array[lo2..hi2 :char ] of integer);
var
   z   : char;
begin
   z := lo1;
   aa1[z] := 3;
   aa1[hi2] := 3;
end;

procedure test( procedure p(aa1, aa2: array[lo..hi :char ] of integer ) );
begin
   p(aci, aci1);
end; { test }

begin {e122}

   tt1(pp1);
   tt1(pp2);
   tt2(pp1);
   tt2(pp2);

   test(p1);    { OK }
   test(p2);    { !!! conformant arrays not grouped }
   writeln( 'fails: conformant array parameter list type error not detected' );

end. { e122 }

