raz / conform / run / ViewNegative.raz

18 lines · 263 B · raw · history · last change f784f531

1module ViewNegative;
2(* A negative index to a view is past the end too *)
3import Out;
4
5var mem: [16]U8;
6
7proc at(i: INT): I64;
8begin
9 return mem[i].(I64);
10end;
11
12proc main*;
13begin
14 Out.int(at(0)); Out.ln;
15 Out.int(at(-1)); Out.ln;
16end;
17
18end ViewNegative.