Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
structs
/
nested_struct_embed_method_call_test.v
22
lines
·
18
sloc
·
249 bytes
·
6488041a749df9762348d019c4223908c476f2e2
Raw
1
struct
Foo1 {
2
x int
3
}
4
5
struct
Foo2 {
6
Foo1
7
}
8
9
struct
Foo3 {
10
Foo2
11
}
12
13
fn
(f Foo1) bar() string {
14
println(
'Foo1.bar()'
)
15
return
'Foo1.bar()'
16
}
17
18
fn
test_nested_struct_embed_method_call() {
19
f3 := Foo3{}
20
ret := f3.bar()
21
assert ret ==
'Foo1.bar()'
22
}
23