v2 / vlib / v / checker / tests / ambiguous_field_method_err.vv
26 lines · 21 sloc · 207 bytes · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1struct Foo {
2 name int = 5
3}
4
5struct Bar {
6 Foo
7 Foo2
8}
9
10struct Foo2 {
11 name string
12}
13
14fn (f Foo2) test() {
15 println(f)
16}
17
18fn (f Foo) test() {
19 println(f)
20}
21
22fn main() {
23 b := Bar{}
24 b.test()
25 n := b.name
26}
27