Skip to content

Fix deeply nested local function compilation and sibling order\n\n- M…#134

Open
theolivenbaum wants to merge 2 commits intomasterfrom
fix/deeply-nested-local-functions-12383581697002567823
Open

Fix deeply nested local function compilation and sibling order\n\n- M…#134
theolivenbaum wants to merge 2 commits intomasterfrom
fix/deeply-nested-local-functions-12383581697002567823

Conversation

@theolivenbaum
Copy link
Collaborator

…odified LocalFunctionReplacer to sort local functions by nesting depth (descending) and then by document position (ascending). This ensures inner functions are processed before outer functions (correctly handling nesting) while processing sibling functions in their original order.\n- Introduced tempInits to buffer initialization statements within the processing loop, ensuring declarations are always added in document order regardless of processing order.\n- Fixed a potential KeyNotFoundException in updatedBlocks merging by checking tempInits inside the loop for nested block updates and handling the consumption of initialization statements incrementally.\n- Verified fix with MinimumFailing_DeeplyNestedLocals integration test.

google-labs-jules bot and others added 2 commits February 12, 2026 21:34
…odified `LocalFunctionReplacer` to sort local functions by nesting depth (descending) and then by document position (ascending). This ensures inner functions are processed before outer functions (correctly handling nesting) while processing sibling functions in their original order.\n- Introduced `tempInits` to buffer initialization statements within the processing loop, ensuring declarations are always added in document order regardless of processing order.\n- Fixed a potential `KeyNotFoundException` in `updatedBlocks` merging by checking `tempInits` inside the loop for nested block updates and handling the consumption of initialization statements incrementally.\n- Verified fix with `MinimumFailing_DeeplyNestedLocals` integration test.

Co-authored-by: theolivenbaum <8791811+theolivenbaum@users.noreply.github.com>
…odified `LocalFunctionReplacer` to sort local functions by nesting depth (descending) and then by document position (ascending). This ensures inner functions are processed before outer functions (correctly handling nesting) while processing sibling functions in their original order.\n- Introduced `tempInits` to buffer initialization statements within the processing loop, ensuring declarations are always added in document order regardless of processing order.\n- Fixed a potential `KeyNotFoundException` in `updatedBlocks` merging by checking `tempInits` inside the loop for nested block updates and handling the consumption of initialization statements incrementally.\n- Verified fix with `MinimumFailing_DeeplyNestedLocals` integration test.

Co-authored-by: theolivenbaum <8791811+theolivenbaum@users.noreply.github.com>
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