Post

I don't know that it shouldn't be available in the else block. In that specific example I can't imagine one would often be using `resource` in the else block but what if it went into a few `else if()` blocks first? I could imagine a need for `resource` to still be around in an `else if()` block.

Well my opinion on this is weak either way because regardless of the final convention, there are ways to write the code to make memory free when you want and they don't seem particularly burdensome. Eg. if Rust-like you could just declare the viable outside the if in a using block to keep it scoped.

That said, I think if had to guess the behavior without looking at documentation I would guess that it's still available in the `else` so that's slightly more natural seeming to me...but I wouldn't be frustrated to learn it wasn't and the rust way would bias towards less resource usage.

If we go with "visible in else" it's actually pretty hard to get disposal to happen before the else! Try rewriting this without relying on "dispose before else": if (using resource = getResource(); resource.needsUpdate) { resource.update(); } else { await postMessage('no updates required'); }