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/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:ec90f706-f910-4db6-ef55-554dd54a3e7d |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | 9BC4:330DBF:2F5E11F:411D8FA:6972B575 |
| html-safe-nonce | 9ec06afb2d9d186f617daf496c539f51aca06e73ce42f1b5b8b015df102fac73 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkM0OjMzMERCRjoyRjVFMTFGOjQxMUQ4RkE6Njk3MkI1NzUiLCJ2aXNpdG9yX2lkIjoiNzg5NjU2OTk4NTYyOTMzNjk0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 86fc7e0b241a5707a3c4025c827dbda8e1571156b49ef02741a0df645b46096b |
| hovercard-subject-tag | pull_request:1308114327 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/checks |
| 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 | 51c0d0848f5569c6fa2198e9d69bd5f8f94a83c9fa3659e40728e7732afab130 |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10c5e2f2307495b2750073db87e9a5d3356a924f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width