| 1 | (* Constants of an integer type wrap as the program would; untyped |
| 2 | ones don't; a shift of an untyped constant is untyped. *) |
| 3 | module ConstWrap; |
| 4 | import Out; |
| 5 | |
| 6 | proc main*; |
| 7 | var a, c: U8; b: I64; d: INT; |
| 8 | begin |
| 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; |
| 17 | end; |
| 18 | |
| 19 | end ConstWrap. |