raz / conform / run / ConstWrap.raz

19 lines · 421 B · raw · history · last change b38de572

1(* Constants of an integer type wrap as the program would; untyped
2 ones don't; a shift of an untyped constant is untyped. *)
3module ConstWrap;
4import Out;
5
6proc main*;
7var a, c: U8; b: I64; d: INT;
8begin
9 a := U8(250) + 10;
10 b := 1 shl 40;
11 d := -16 shr 2;
12 c := U8(0C0H) shl 1;
13 Out.int(I64(a)); Out.ln;
14 Out.int(b); Out.ln;
15 Out.int(d); Out.ln;
16 Out.int(I64(c)); Out.ln;
17end;
18
19end ConstWrap.