Title says the problem.
Simple snippet:
class A {
[Symbol.dispose] = function (this: A) {
print('Dispose')
}
}
using a = new A();
Translates into this:
A = __TS__Class()
A.name = "A"
function A.prototype.____constructor(self)
self[Symbol.dispose] = function(self)
print("Dispose")
end
end
a = __TS__New(A)
-- Here is no disposing
While scoping it with brackets causing generating __TS__Using:
do
return __TS__Using(
nil,
function(a)
end,
__TS__New(A)
)
end
Title says the problem.
Simple snippet:
Translates into this:
While scoping it with brackets causing generating __TS__Using: