| 1 | // fixes https://github.com/vlang/v/issues/3600, test based on a simplified version of example by https://github.com/radare |
| 2 | fn test_invalid_insert_references() { |
| 3 | b := 0 |
| 4 | mut a := [&b] |
| 5 | mut c := 1 |
| 6 | a << &c |
| 7 | c = 2 |
| 8 | a << 1 |
| 9 | println(a) |
| 10 | } |
| 11 | |
| 12 | fn main() { |
| 13 | test_invalid_insert_references() |
| 14 | } |
| 15 |