const should_not_change = Employee{ "Ohh" }
struct Employee {
mut:
name string
}
fn main() {
println(should_not_change)
mut arr := []&Employee{}
arr << &should_not_change
arr[0].name = "Bhak be"
println(should_not_change)
}
Expected the compilation to fail, however compiled and ran output:
$ v run main.v
Employee{
name: 'Ohh'
}
Employee{
name: 'Bhak be'
}
Expected the compilation to fail, however compiled and ran output: