slang icon indicating copy to clipboard operation
slang copied to clipboard

Shadowing of argument should be an error (at least opt-in to do so)

Open savage309 opened this issue 3 years ago • 1 comments

I have a function like that because of a faulty merge conflict resolution

void foo(inout Bar bar)
{
    Bar bar;
    InitBar(bar);
    // …
}

Took me a long time to figure it out in a large code base.

It would be really nice if this is in error (yeah, it is valid spec, but if anyone wants to make that on purpose, maybe just not allow them). Or, if there is an opt-in option to do so, it will be good enough.

savage309 avatar Aug 25 '21 04:08 savage309

Good one to fix as part of our lang cleanup in q3

natduca avatar Dec 01 '23 19:12 natduca