[Immutable] in function arguments doesn't work
I occasionally stumbled upon this thread where it was suggested to implement [Immutable]
for function args. I couldn't find any documentation, but blindly putting the attribute as in examples doesn't cause compilation errors, so it was implemented. Well, kind of: assigning to immutable variable doesn't cause errors either :)
Steps to reproduce (in terms of terminal commands)
$ cat test.vala
void foo([Immutable] string arg) {
stderr.printf("%s\n", arg);
arg = "";
}
public void main () {
foo("hey");
}
$ valac test.vala
Expected
Build fails because the immutable variable gets assigned
Actual
Build succeeds
Version
valac 0.40.0.247-5e72