The Ada Program: test.adb

  1 -- test.adb:  program to test array type compatibility
  2 
  3 procedure Test is
  4 
  5    type AT1 is array (1..10) of Boolean;
  6    type AT2 is array (1..10) of Boolean;
  7 
  8    A  : AT1;
  9    B  : AT2;
 10    C  : array (1..10) of Boolean;
 11    D,E: array (1..10) of Boolean;
 12    F,G: AT1;
 13 
 14 begin
 15 
 16    -- A, B, C, are mutually type-incompatible, ie.,
 17    --
 18    --   A:=B; A:=C; B:=C;
 19    --
 20    -- are illegal, as are A=B, A/=C, B=C, A or B, etc.
 21    -- Even D:=E; is illegal.
 22 
 23    F := G;
 24    A := F;
 25 
 26 end Test;