TypeScript 5.2
devblogs.microsoft.com
devblogs.microsoft.com
You can forget to use `with` as well. Destructors in python are called when the reference count hits zero or during a gc pass. These new typescript destructors apply to the variable, not the object, so they run when the variable goes out of scope, regardless of what other references there might be to the same object. If you want to emulate `with` more closely, you can create a new scope for your `using` declaration, and put it at the very top of that new scope.
Edit: It's also a pending Stage 3 proposal for EcmaScript.
https://github.com/tc39/proposal-explicit-resource-managemen...
That's a safe bet.
TypeScript's ability to detect problems in the code seems superior than what Visual Studio ships with for C# - for example it doesn't warn about forgetting to `await` a method call.
With Array.prototype.with, it's now array.with(0, 3), which isn't exactly the most descriptive signature in the world.