v
v copied to clipboard
When struct is initalized with wrong type for field and field is named, compiler fails
fn main() {
p := Person{name:'robert', age:'cat'}
println('name: ${p.name}, age: ${p.age}')
}
struct Person {
name string
age int
}
You just found a bug. V can't compile this program, but it should. Please create a GitHub issue.
I doubt whether this is really a bug. The developer clearly makes a mistake here and I think it should not be able to compile.