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

program e1058( output );

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

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

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

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

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

begin { e1058 }

   e := black;
   n := 2;

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

