{: test that constant expression type error causes a compilation error }

program e1057( output );

type
   colour = ( black, brown, red, orange, yellow, green, blue, violet, grey, white);

const
   ac0 =  nil + 3;
   ac1 =  nil - 3;
   ac2 =  nil div 3;
   ac3 =  nil mod 3;
   ac4 =  nil * 3;

   ac5 =  3 + nil;
   ac6 =  3 - nil;
   ac7 =  3 div nil;
   ac8 =  3 mod nil;
   ac9 =  3 * nil;

   c1 = pred(nil); {!!! arg must be an integer}
   c2 = succ(nil); {!!! arg must be an integer}
   c3 = odd(nil); {!!! arg must be an integer}
   c4 = abs(nil); {!!! arg must be an integer}
   c5 = sqr(nil); {!!! arg must be an integer}
   c8 = chr(nil); {!!! arg must be an integer}
   c9 = -(nil);   {!!! arg must be an integer}
   c0 = +(nil);   {!!! arg must be an integer}
   ca = -nil;     {!!! arg must be an integer}
   cb = +nil;     {!!! arg must be an integer}

var
   e : colour;
   n : integer;
   s : packed array[1..20] of char;

begin { e1057 }

   e := black;
   n := 2;

   writeln( 'constant expression type error not detected' );
end. { e1057 }

