mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
24 lines
204 B
V
24 lines
204 B
V
struct Foo {
|
|
name int = 5
|
|
}
|
|
struct Bar {
|
|
Foo
|
|
Foo2
|
|
}
|
|
|
|
struct Foo2 {
|
|
name string
|
|
}
|
|
fn (f Foo2) test() {
|
|
println(f)
|
|
}
|
|
|
|
fn (f Foo) test() {
|
|
println(f)
|
|
}
|
|
|
|
fn main() {
|
|
b := Bar{}
|
|
b.test()
|
|
n := b.name
|
|
} |