 $c+
 module test11_7 { Semantic Checking for arrays.
  test of arrays (2 dimension ) and typedefinition}
 private
  typedefinition integer index;
  index i;
  constant max = 3;
  constant lmax = 6;
  typedefinition integer range [1..max] bounds;
  typedefinition integer array [bounds][bounds] matrix;
  typedefinition integer array [bounds] vector;
  typedefinition Boolean array [bounds] bvector;
  typedefinition integer array [index] wrong; { error, not a range}

  typedefinition integer range [1..lmax] big_bounds;
  typedefinition integer array [big_bounds] lvector;
  
  typedefinition integer range[0..1] ib;
  typedefinition Boolean range[false..true] bb;
  
  integer array [ib] ibvec;
  integer array [bb] bbvec;
 
  matrix a;
  vector v;
  bvector b;
  lvector long;
 
  begin
  i := 1;
  do i <= max -> read a[i][1]; i := i+1; od; 
  a[2] := a[1]; { ok}
  a[3] := a[2]; { ok}
  v := a[1]; { ok}
  b := v; { illegal}
  v := a; { illegal}
  a := v; { illegal}
  ibvec := bbvec; { illegal;}
  long := v; { illegal}
  long[1] := v[2]; { ok}
  i := v; { illegal}
  v := i; { illegal}
  v := a[1] + a[2]; { illegal}
  v := a[1] * a[2]; { illegal}
  v := - a[1]; { illegal}
  if i -> skip; fi; { illegal}
  if b[1] -> skip; fi; { ok}
  if b -> skip; fi; { illegal}
  i :=  ibvec[true]; { illegal}
  i := bbvec[0]; { illegal}
  { output
   none}
  end. { 15 errors. }
