function loggy(id: string) {
print(`Creating ${id}`);
return {
[Symbol.dispose]() {
print(`Disposing ${id}`);
}
}
}
function func() {
using a = loggy("a");
using b = loggy("b");
{
using c = loggy("c");
using d = loggy("d");
}
using e = loggy("e");
return;
// Unreachable.
// Never created, never disposed.
using f = loggy("f");
}
function main()
{
func();
print("done.");
}