3 ms·
I don't think that's quite the same issue. That `a` is reassigned doesn't make it unused. It is, after all, a variable. And that's why this issue is kind of ha
by nkozyra 4y ago
I don't think that's quite the same issue. That `a` is reassigned doesn't make it unused. It is, after all, a variable.
And that's why this issue is kind of hard. It's why I end up block scoping a lot of error code in Go, which is ugly but generally safer.
- masklinn 4y ago> I don't think that's quite the same issue. It is. > That `a` is reassigned doesn't make it unused. It is, after all, a variable. But that's exactly why it's bad, "unused variable" is not a super useful signal in the first place, and if you assert that everything must be used then you need to protect against "unused stores" instead. SSA tells us there is essentially no difference between assigning and reassigning.