Skip to content

Fix with tuple only processing first binding in build_with_dispose#5095

Merged
SeanTAllen merged 1 commit intomainfrom
fix-with-tuple-dispose-all-bindings
Apr 1, 2026
Merged

Fix with tuple only processing first binding in build_with_dispose#5095
SeanTAllen merged 1 commit intomainfrom
fix-with-tuple-dispose-all-bindings

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

The loop in build_with_dispose returned on the first recursive call, so only the first tuple element was processed. Later _ patterns were not diagnosed as errors, and dispose calls were only emitted for the first binding.

Uses the error accumulation pattern (matching sugar_match_capture) so every element is walked and all diagnostics are reported at once.

Adds three libponyc regression tests: dontcare in second position (1 error), both dontcare (2 errors, verifying accumulation), and a happy-path two-element tuple compile.

Replaces #5077.

The loop in build_with_dispose returned on the first recursive call,
so only the first tuple element was processed. Later `_` patterns were
not diagnosed as errors, and dispose calls were only emitted for the
first binding.

Use the error accumulation pattern (matching sugar_match_capture) so
every element is walked and all diagnostics are reported at once.

Add three libponyc regression tests: dontcare in second position,
both dontcare (verifies accumulation), and a happy-path two-element
tuple compile.

Replaces #5077
@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Apr 1, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Apr 1, 2026
@SeanTAllen SeanTAllen merged commit 0403858 into main Apr 1, 2026
22 checks passed
@SeanTAllen SeanTAllen deleted the fix-with-tuple-dispose-all-bindings branch April 1, 2026 18:29
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Apr 1, 2026
github-actions bot pushed a commit that referenced this pull request Apr 1, 2026
github-actions bot pushed a commit that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants