We currently do shadowing in one case: inside a function, when a global symbol is not used.
We could do it in more cases, i.e. each time we enter a new scope (if-body, for-body, etc.).
For example, we could do:
int x = ...;
for(int i = 0; i < 10; i++) {
int x = ...; // if the outer x is not used inside the for-loop
}
We currently do shadowing in one case: inside a function, when a global symbol is not used. We could do it in more cases, i.e. each time we enter a new scope (if-body, for-body, etc.).
For example, we could do: