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

program e1056( output );

const
   on  = true;
   off =  false;

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

const
   ac0 =  true + 3;
   ac1 =  false - 3;
   ac2 =  true div 3;
   ac3 =  on mod 3;
   ac4 =  off * 3;

   ac5 =  3 + on;
   ac6 =  3 - off;
   ac7 =  3 div true;
   ac8 =  3 mod false;
   ac9 =  3 * true;

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

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

begin { e1056 }

   e := black;
   n := 2;

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

