Fix function forward references in eldritch-core#2079
Conversation
…tion hoisting pass This commit fixes a bug in `eldritch-core` where functions failed to resolve references to other functions that were defined later in the same execution block. By introducing a `hoist_functions` pre-pass, function signatures are successfully evaluated and stored in the environment before any statements are executed, permitting forward-references. Default arguments are skipped during hoisting and correctly evaluated during the sequential evaluation pass. This maintains compatibility with dynamically evaluated parameters that rely on prior sequentially-executed statements in the same scope, and accurately resolves redefinitions. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary
Previous Results
Insights
Slowest Tests
🎉 No failed tests in this run. | 🍂 No flaky tests in this run. Github Test Reporter by CTRF 💚 |
Fix
NameErrorfor forward function references by adding a pre-execution hoisting pass.This commit fixes a bug in
eldritch-corewhere functions failed to resolve references to other functions that were defined later in the same execution block.By introducing a
hoist_functionspre-pass, function signatures are successfully evaluated and stored in the environment before any statements are executed, permitting forward-references.Default arguments are skipped during hoisting and correctly evaluated during the sequential evaluation pass. This maintains compatibility with dynamically evaluated parameters that rely on prior sequentially-executed statements in the same scope, and accurately resolves redefinitions.
PR created automatically by Jules for task 16218085057380453992 started by @KCarretto