Skip to content

test: add regression test for issue #37 undefined variable bug#38

Closed
Unisay wants to merge 1 commit into
mainfrom
yura/issue-37-repro
Closed

test: add regression test for issue #37 undefined variable bug#38
Unisay wants to merge 1 commit into
mainfrom
yura/issue-37-repro

Conversation

@Unisay

@Unisay Unisay commented Oct 14, 2025

Copy link
Copy Markdown
Collaborator

Add golden test reproducing the scenario from issue #37 where monadic code with nested do-blocks and function composition previously generated invalid Lua code with undefined variable references (Bind11).

The test verifies correct compilation of:

  • Nested monadic do-blocks
  • Bind dictionary threading through local scopes
  • Function composition within array literals

Current compilation generates valid Lua code with properly scoped local variables, suggesting the bug has been fixed. This test serves as a regression guard.

Add golden test reproducing the scenario from issue #37 where
monadic code with nested do-blocks and function composition
previously generated invalid Lua code with undefined variable
references (Bind11).

The test verifies correct compilation of:
- Nested monadic do-blocks
- Bind dictionary threading through local scopes
- Function composition within array literals

Current compilation generates valid Lua code with properly
scoped local variables, suggesting the bug has been fixed.
This test serves as a regression guard.
@Unisay Unisay self-assigned this Oct 14, 2025
Unisay added a commit that referenced this pull request Jun 12, 2026
Golden test from PR #38 with the explicit export list from PR #39:
with 'module ... (baz) where' the non-exported bindings get inlined
and the generated Lua references an undefined variable Bind11.
The luacheck golden suite fails with W113 until the bug is fixed.
@Unisay

Unisay commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

Folded this test into #43 together with the one-line export list change from #39, which is what makes it actually reproduce the bug. Closing in favor of that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant