v
v copied to clipboard
nested auto initialized struct with required attribute doesn't give an error
OS: WSL2 Ubuntu 20.04
What did you do?
struct Foo {
bar Bar
}
struct Bar {
egg Egg
}
struct Egg {
name string [required]
}
fn main() {
f := Foo{}
println(f)
}
What did you expect to see? Foo contains a value that needs manual initialization (error)
What did you see instead? it compiles and prints
Foo{
bar: Bar{
egg: Egg{
name: ''
}
}
}
similar problem described here: https://github.com/vlang/v/issues/10823