Title: Root-level resources with usings not being disposed · Issue #1632 · TypeScriptToLua/TypeScriptToLua · GitHub
Open Graph Title: Root-level resources with usings not being disposed · Issue #1632 · TypeScriptToLua/TypeScriptToLua
X Title: Root-level resources with usings not being disposed · Issue #1632 · TypeScriptToLua/TypeScriptToLua
Description: 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...
Open Graph Description: 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.pro...
X Description: 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&qu...
Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1632
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Root-level resources with usings not being disposed","articleBody":"Title says the problem.\n\nSimple snippet:\n\n```ts\nclass A {\n [Symbol.dispose] = function (this: A) {\n print('Dispose')\n }\n}\nusing a = new A();\n```\n\n[Translates](https://typescripttolua.github.io/play/#code/5.4/MYGwhgzhAECC0G8BQ1XQNoGUCeBbARgPYgB0AJgJYQAOhEApgLrQC80AZgK4B2wALhULdoACj4ALKgC44ASkQo0S6gCcK3PiIDkAESq0GW2YtQBfJOaQB6K9ACqvQrlz0N0CVXeF3agOa-6FWhKGjp1X2tbZE4IcOgwVmhuegB3OBFZAG5I6FMgA) into this:\n```lua\nA = __TS__Class()\nA.name = \"A\"\nfunction A.prototype.____constructor(self)\n self[Symbol.dispose] = function(self)\n print(\"Dispose\")\n end\nend\na = __TS__New(A)\n-- Here is no disposing\n```\n\nWhile scoping it with brackets causing generating __TS__Using:\n```ts\n{\nusing a = new A();\n}\n```\n\n```lua\ndo\n return __TS__Using(\n nil,\n function(a)\n end,\n __TS__New(A)\n )\nend\n```","author":{"url":"https://github.com/inklesspen1rus","@type":"Person","name":"inklesspen1rus"},"datePublished":"2025-05-10T07:13:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1632/TypeScriptToLua/issues/1632"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f28dc638-4584-1eb8-ef86-8afcaee69b71 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83DE:16BB7B:B09578:EEBE7A:69731EDC |
| html-safe-nonce | a852e3c281e23c38a59854cb1296bcb5700353b1a8788416d707133d5255e55c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0RFOjE2QkI3QjpCMDk1Nzg6RUVCRTdBOjY5NzMxRURDIiwidmlzaXRvcl9pZCI6IjcwMTEyMDk4NjgyMjgxMDc5OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 826a1bf27c2ebcfd182e7edbe3eb15c32d7e5dae1c2093de046aca1adf12fcaa |
| hovercard-subject-tag | issue:3053841689 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TypeScriptToLua/TypeScriptToLua/1632/issue_layout |
| twitter:image | https://opengraph.githubassets.com/057d0b73d9b4fe9a68b2e302178dcc7ef267fddd6332c0ed565446eef6cae3c4/TypeScriptToLua/TypeScriptToLua/issues/1632 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/057d0b73d9b4fe9a68b2e302178dcc7ef267fddd6332c0ed565446eef6cae3c4/TypeScriptToLua/TypeScriptToLua/issues/1632 |
| og:image:alt | 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.pro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | inklesspen1rus |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| turbo-cache-control | no-preview |
| go-import | github.com/TypeScriptToLua/TypeScriptToLua git https://github.com/TypeScriptToLua/TypeScriptToLua.git |
| octolytics-dimension-user_id | 44121206 |
| octolytics-dimension-user_login | TypeScriptToLua |
| octolytics-dimension-repository_id | 115876595 |
| octolytics-dimension-repository_nwo | TypeScriptToLua/TypeScriptToLua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 115876595 |
| octolytics-dimension-repository_network_root_nwo | TypeScriptToLua/TypeScriptToLua |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width