v
v copied to clipboard
checker: fix nested option struct with required attr init (fix #17513)
This PR fix nested option struct with required attr init (fix #17513).
- Fix nested option struct with required attr init.
- Add test.
struct AA {
bb ?BB // defaults to none
}
struct BB {
x string [required]
}
fn main() {
aa := AA{}
println(aa)
assert aa.bb == none
}
PS D:\Test\v\tt1> v run .
AA{
bb: Option(error: none)
}