raz / test / msg / FrameSlice.err

21 lines · 1.5 KiB · raw · history · last change 8aae98b9

1conform/err/FrameSlice.raz:14:12: error: can't return a slice of the procedure's own frame
2 14 | return h[0..8]; (* the procedure's copy *)
3 | ^^^^^^^
4help: it is gone once the procedure returns: take the array as a var parameter, or fill a buffer the caller gives
5conform/err/FrameSlice.raz:20:12: error: can't return a slice of the procedure's own frame
6 20 | return a; (* the array, silently a slice *)
7 | ^
8help: it is gone once the procedure returns: take the array as a var parameter, or fill a buffer the caller gives
9conform/err/FrameSlice.raz:26:12: error: can't return a slice of the procedure's own frame
10 26 | return p.a[0..n], n; (* one of several results *)
11 | ^^^^^^^^^
12help: it is gone once the procedure returns: take the array as a var parameter, or fill a buffer the caller gives
13conform/err/FrameSlice.raz:31:12: error: can't return a slice of the procedure's own frame
14 31 | return [1, 2, 3]; (* a hidden variable of the call *)
15 | ^^^^^^^^^
16help: it is gone once the procedure returns: take the array as a var parameter, or fill a buffer the caller gives
17conform/err/FrameSlice.raz:42:12: error: can't return a slice of the procedure's own frame
18 42 | return whole()[0..2]; (* the array whole returns, a temporary *)
19 | ^^^^^^^^^^^^^
20help: it is gone once the procedure returns: take the array as a var parameter, or fill a buffer the caller gives
21raz: 5 errors