class Thing implements Disposable {
x: number = 5;
constructor() {}
[Symbol.dispose]() {}
}
(async () => {
using thing = new Thing();
thing.x = 10;
})();
generates the lua code:
(function()
return __TS__AsyncAwaiter(function(____awaiter_resolve)
return ____awaiter_resolve(
nil,
__TS__Await(__TS__UsingAsync(
nil,
function(thing)
return __TS__AsyncAwaiter(function(____awaiter_resolve)
thing.x = 10
end)
end,
__TS__New(Thing)
))
)
end)
end)(nil)
However, in the definition of __TS__UsingAsync, cb is called with nil as the first parameter. This causes an error at runtime, since thing is nil.
generates the lua code:
However, in the definition of
__TS__UsingAsync,cbis called with nil as the first parameter. This causes an error at runtime, sincethingis nil.