Title: Lua.fromIR: topLevelNames parameter is always empty, guarded branches are dead code · Issue #146 · purescript-lua/purescript-lua · GitHub
Open Graph Title: Lua.fromIR: topLevelNames parameter is always empty, guarded branches are dead code · Issue #146 · purescript-lua/purescript-lua
X Title: Lua.fromIR: topLevelNames parameter is always empty, guarded branches are dead code · Issue #146 · purescript-lua/purescript-lua
Description: Problem Every production call of fromIR in fromUberModule (lib/Language/PureScript/Backend/Lua.hs) passes Set.empty for the topLevelNames parameter, so both branches guarded by Set.member ... topLevelNames (the special case in IR.Ref and...
Open Graph Description: Problem Every production call of fromIR in fromUberModule (lib/Language/PureScript/Backend/Lua.hs) passes Set.empty for the topLevelNames parameter, so both branches guarded by Set.member ... topLe...
X Description: Problem Every production call of fromIR in fromUberModule (lib/Language/PureScript/Backend/Lua.hs) passes Set.empty for the topLevelNames parameter, so both branches guarded by Set.member ... topLe...
Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/146
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lua.fromIR: topLevelNames parameter is always empty, guarded branches are dead code","articleBody":"## Problem\n\nEvery production call of `fromIR` in `fromUberModule` (`lib/Language/PureScript/Backend/Lua.hs`) passes `Set.empty` for the `topLevelNames` parameter, so both branches guarded by `Set.member ... topLevelNames` (the special case in `IR.Ref` and the qualified local names in the `Let`/`RecursiveGroup` lowering) are dead code.\n\nBeyond the noise, the dead `Ref` branch is a trap: it matches a `Local` name against top-level names while ignoring the reference's index, so if anyone ever passes a non-empty set, a local that shadows a top-level name would silently compile to an `M.field` access.\n\n## Approach\n\nRemove the `topLevelNames` parameter and both guarded branches. This eliminates the trap and simplifies the `fromIR` signature.\n\n## Prerequisites / Relations\n\nDead-code / codegen cleanup, found during the 2026-07-02 backend audit. Independent. Resolves a hypothesis from the #37 session notes: the miscapture is not reachable today precisely because the set is always empty.\n\n## Verification / Measurement\n\nThe removal is behaviour-preserving — the structural and eval goldens are unchanged, confirming the branches were genuinely dead — and the `Local`-shadows-top-level miscompilation trap is no longer reachable because the code path no longer exists.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-02T18:18:17Z","url":"https://github.com/purescript-lua/purescript-lua/issues/146"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:13bf0adb-facc-9bc8-bdf0-c4b996644f8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D8A:11486D:82A540:AB4780:6B00DB67 |
| html-safe-nonce | f85f7f903efb0186ad485dff8fd8b713aa41ecf64712a07503a89f4dec8e5e02 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDhBOjExNDg2RDo4MkE1NDA6QUI0NzgwOjZCMDBEQjY3IiwidmlzaXRvcl9pZCI6IjgwNjA1MzQzMDQ5NjAyMDc3MjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1585f97f1e7735e5a2ad7bda03c0522ee04c65dd41aea87de5fee7e1e923507c |
| hovercard-subject-tag | issue:4797142789 |
| 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/purescript-lua/purescript-lua/146/issue_layout |
| twitter:image | https://opengraph.githubassets.com/385bc40835c27989b37ce83dea0df836c5f298f5b47114c6595bf9625be45f38/purescript-lua/purescript-lua/issues/146 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/385bc40835c27989b37ce83dea0df836c5f298f5b47114c6595bf9625be45f38/purescript-lua/purescript-lua/issues/146 |
| og:image:alt | Problem Every production call of fromIR in fromUberModule (lib/Language/PureScript/Backend/Lua.hs) passes Set.empty for the topLevelNames parameter, so both branches guarded by Set.member ... topLe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Unisay |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-preview |
| go-import | github.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git |
| octolytics-dimension-user_id | 131581790 |
| octolytics-dimension-user_login | purescript-lua |
| octolytics-dimension-repository_id | 587200487 |
| octolytics-dimension-repository_nwo | purescript-lua/purescript-lua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587200487 |
| octolytics-dimension-repository_network_root_nwo | purescript-lua/purescript-lua |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width