v2 / vlib / v / checker / tests / invalid_insert_references_test.vv
14 lines · 13 sloc · 284 bytes · 4d0f835548a64da1a365222392331cd531492222
Raw
1// fixes https://github.com/vlang/v/issues/3600, test based on a simplified version of example by https://github.com/radare
2fn 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
12fn main() {
13 test_invalid_insert_references()
14}
15