2 ms·
The warning says it right away, the first a is shadowed, not reassigned, here. The difference is that when a is reassigned the 7 is lost, while it should be st
by weinzierl 9y ago
The warning says it right away, the first a is shadowed, not reassigned, here.
The difference is that when a is reassigned the 7 is lost, while it should be still around when shadowed. I don‘t know of a way to access the 7 in this example however.
- runeks 9y agoIf there’s no way to access the 7 after it’s shadowed, why couldn’t an optimized garbage collector throw it away after it’s shadowed, thus making it equivalent to reassignment?