v2 / vlib / v / tests / consts / const_global_arr_test.v
17 lines · 14 sloc · 203 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1struct Foo {
2 index int
3}
4
5const foo5 = Foo{
6 index: 5
7}
8const foo2 = Foo{
9 index: 2
10}
11
12const foos = [foo5.index, foo2.index]!
13
14fn test_main() {
15 fooz := [foo5.index, foo2.index]!
16 assert foos == fooz
17}
18