Title: Fixed multi returning all values by lolleko · Pull Request #1428 · TypeScriptToLua/TypeScriptToLua · GitHub
Open Graph Title: Fixed multi returning all values by lolleko · Pull Request #1428 · TypeScriptToLua/TypeScriptToLua
X Title: Fixed multi returning all values by lolleko · Pull Request #1428 · TypeScriptToLua/TypeScriptToLua
Description: We try to avoid using select() when we use [0] to access the first value of multiple returns (e.g. multiCall()[0]). In that case, we omit the select(). Unfortunately, this only works if the value is assigned directly (local x = multiCall()). In cases where the value is not assigned, omitting the select and keeping just the call expression (multiCall()) will lead to all return values being passed on. (See #1411) To fix this, we now wrap the call in parentheses using a new Lua parentheses expression. Using parentheses is the correct way to keep only the first value of multiple returns (see https://www.lua.org/manual/5.1/manual.html#2.5) TL;DR: multiCall()[0] used to transpile to multiCall() now it transpiles to (multiCall()) which ensures correct semantics across all potential usages. This fixes #1411
Open Graph Description: We try to avoid using select() when we use [0] to access the first value of multiple returns (e.g. multiCall()[0]). In that case, we omit the select(). Unfortunately, this only works if the value ...
X Description: We try to avoid using select() when we use [0] to access the first value of multiple returns (e.g. multiCall()[0]). In that case, we omit the select(). Unfortunately, this only works if the value ...
Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/pull/1428
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4f7bb711-343d-5cf8-8a7c-2c18425a2e24 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9E64:14965D:27C89DD:37187E7:69729B1F |
| html-safe-nonce | 3f2c041099708f1b441b6c4581d0479114b3aef875d48dab9e69f17c8ff4605c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTY0OjE0OTY1RDoyN0M4OUREOjM3MTg3RTc6Njk3MjlCMUYiLCJ2aXNpdG9yX2lkIjoiMjk4NDc0NjEyOTIyOTUxOTY0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9329f84196d7bef411b1da0a618a9a85d1e8722b8b0c636e6abbebcbd2792874 |
| hovercard-subject-tag | pull_request:1308114327 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/TypeScriptToLua/TypeScriptToLua/pull/1428/files |
| twitter:image | https://avatars.githubusercontent.com/u/4759511?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4759511?s=400&v=4 |
| og:image:alt | We try to avoid using select() when we use [0] to access the first value of multiple returns (e.g. multiCall()[0]). In that case, we omit the select(). Unfortunately, this only works if the value ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72bb1c46bb1ebdc0dc83a0a57b64c3b4d668c125d1125d94898213a4c9db8da2 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7b2326416cb9f2fa4ab7b6ede33ad46d0dd431a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width