
louise
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#1201 · main · 9 min 57 s
1Étoiles
0Forks
0Issues
| 1 | // `array.set` out of range stops the actor, on both backends; the native |
| 2 | // runtime releases the array and the value it was given. |
| 3 | |
| 4 | import std/array |
| 5 | import std/io |
| 6 | |
| 7 | pub fn main :: -> () / <io> |
| 8 | { |
| 9 | let a = array.from_list ["x", "y", "z"] |
| 10 | io.println (show (array.set a 2 "w")) |
| 11 | let b = array.set a 3 "never stored" |
| 12 | io.println ("never printed " <> show b) |
| 13 | } |
| 14 | //> [x, y, w] |
| 15 | //! panic: array.set: index 3 out of range for length 3 |