Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
vxx2
/
vlib
/
v
/
checker
/
tests
/
struct_fixed_array_init_test.vv
17
lines
·
13
sloc
·
222 bytes
·
9921598c91d2a2483efb1607c8fcbf0ea2feaaa9
Raw
1
module main
2
3
type Data = [3]int | int
4
5
struct Sample {
6
data Data
7
}
8
9
fn test_main() {
10
test := Sample{
11
data: [5, 10, 15]!
12
// data: 5 /* works fine */
13
}
14
15
println(test)
16
assert test.data.str() == 'Data([5, 10, 15])'
17
}
18