3 ms·
No, it really is shadowing. The second `let` allocates a new memory location in the activation record; all future mentions of the variable name will refer to t
by kd5bjo 6y ago
No, it really is shadowing. The second `let` allocates a new memory location in the activation record; all future mentions of the variable name will refer to the new location. The old location still exists, and may have references to it already; references that will continue pointing at the old allocation and will not see anything that happens to the new one. If the old value has a `Drop` implementation, it will run after the second allocation’s `drop()`. The two `let` bindings can even have completely different types.