Title: Encountered error with `{ ...(bCheck && obj) }` · Issue #1642 · TypeScriptToLua/TypeScriptToLua · GitHub
Open Graph Title: Encountered error with `{ ...(bCheck && obj) }` · Issue #1642 · TypeScriptToLua/TypeScriptToLua
X Title: Encountered error with `{ ...(bCheck && obj) }` · Issue #1642 · TypeScriptToLua/TypeScriptToLua
Description: The code works for TypeScript, but it causes errors when used with code generated by TSTL. const obj = { key: 1 } const num = Math.random() const a = 0 // 0, 0.5, 1 const b = { ...(num < a && obj) } generates obj = {key = 1} num = math.r...
Open Graph Description: The code works for TypeScript, but it causes errors when used with code generated by TSTL. const obj = { key: 1 } const num = Math.random() const a = 0 // 0, 0.5, 1 const b = { ...(num < a && obj) ...
X Description: The code works for TypeScript, but it causes errors when used with code generated by TSTL. const obj = { key: 1 } const num = Math.random() const a = 0 // 0, 0.5, 1 const b = { ...(num < a &...
Opengraph URL: https://github.com/TypeScriptToLua/TypeScriptToLua/issues/1642
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Encountered error with `{ ...(bCheck \u0026\u0026 obj) }`","articleBody":"The code works for TypeScript, but it causes errors when used with code generated by TSTL.\n\n```typescript\nconst obj = { key: 1 }\nconst num = Math.random()\nconst a = 0 // 0, 0.5, 1\nconst b = { ...(num \u003c a \u0026\u0026 obj) }\n```\ngenerates\n```lua\nobj = {key = 1}\nnum = math.random()\na = 0\nb = __TS__ObjectAssign({}, num \u003c a and obj)\n```\n\nplayground\n\nhttps://typescripttolua.github.io/play/#code/5.4/MYewdgzgLgBCBGArGBeGBvGBrApgTwC4YBGGAXwChRJYwBXAW1RgFkBDKACwDoAnNsABMQDABQBKKuGgw2zAAwwA9EpjyANGu4BWTcSk0Y8Zpm5nR9JgB5ZMAGR24SceQpA","author":{"url":"https://github.com/qin-tain","@type":"Person","name":"qin-tain"},"datePublished":"2025-06-17T04:13:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1642/TypeScriptToLua/issues/1642"}
| 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:857a8296-b320-f181-7ebc-b581dcedc567 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D236:B411C:265CCB5:34F6125:69729CFE |
| html-safe-nonce | ecac59ede24208c0a209a3db9a546a591728b57d4e9801902a4a106ca1cc58b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjM2OkI0MTFDOjI2NUNDQjU6MzRGNjEyNTo2OTcyOUNGRSIsInZpc2l0b3JfaWQiOiIzMjY4OTg1NDM3MDg2MTk0OTQyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 018394629b34ca867fd53b7b9c02656f8b0a5180682802ff1789965e45cde279 |
| hovercard-subject-tag | issue:3151995395 |
| 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/1642/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6c7c6b30b5ce305f9dd44a57a15a779debc4552b498beb61cf8891f53d0b28ce/TypeScriptToLua/TypeScriptToLua/issues/1642 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6c7c6b30b5ce305f9dd44a57a15a779debc4552b498beb61cf8891f53d0b28ce/TypeScriptToLua/TypeScriptToLua/issues/1642 |
| og:image:alt | The code works for TypeScript, but it causes errors when used with code generated by TSTL. const obj = { key: 1 } const num = Math.random() const a = 0 // 0, 0.5, 1 const b = { ...(num < a && obj) ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | qin-tain |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72bb1c46bb1ebdc0dc83a0a57b64c3b4d668c125d1125d94898213a4c9db8da2 |
| 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 | e746f1a3ddb5c0a91290ff3d5889b5247e0e519e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width