You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you! Unfortunately this problem isn't related to imports/exports, and can't be solved with the barrel technique as described in the documentation. And, due to being large blobs of generated code, I can't exactly go through and replace large blocks of lets with JS objects by hand.
Unlike #1317, I would instead prefer this case to compile, as it would open the door to using TypeScriptToLua with other platforms that generate JavaScript code. (For me specifically, TeaVM and ScalaJS are the most important.) I don't know enough about Lua or TypeScriptToLua to be confident in putting forth a solution (other than just using a local table instead for a large number of locals).
I am currently not looking to add this kind of optimization/inlining into the core transpiler. If you wan to optimize cases like this you can do so yourself with a TypeScript transformer plugin.
Working with code generated via another language to JS/TS can generate a lot of intermediate locals. The standard Lua interpreter caps out at 200.
An MRE:
But in generated code these will often all have purposes (not just generated from an array destructuring).
The text was updated successfully, but these errors were encountered: