v2 / vlib / v / checker / tests / assign_expr_undefined_err_l.vv
32 lines · 26 sloc · 337 bytes · 2332ecff4811b8c97dfda8e825170e9397962519
Raw
1module main
2
3struct Stru {
4mut:
5 a int
6 i Iface2
7}
8
9interface Iface {
10 result() &Iface2
11}
12
13interface Iface2 {
14 result2() Iface
15}
16
17pub fn (s Stru)result() &Iface2 {
18 return &Stru{}
19}
20
21pub fn (s Stru)result2() Iface {
22 return &Stru{}
23}
24
25fn main() {
26 println('hello world')
27 poo := Stru{
28 a: 123
29 i: poo.result()
30 }
31 println('${poo}')
32}
33