v2 / vlib / v / checker / tests / time_duration_assign_to_int_err.vv
20 lines · 16 sloc · 178 bytes · 50b936cd58723a86e121a5ec26561c438c4949eb
Raw
1import time
2
3struct Foo {
4 x int
5}
6
7fn bad_struct_init() {
8 d := time.second
9 _ := Foo{
10 x: d
11 }
12}
13
14fn bad_struct_init_direct() {
15 _ := Foo{
16 x: time.second
17 }
18}
19
20fn main() {}
21