Fix eval -x of local members - #1760
Merged
Merged
Conversation
This fixes a regression where local members cannot be seen by the expression evaluator. Because variable are now parse-time resolved, this builds a truffle node by first constructing a synthetic module of all defined local members, and calls AstBuilder on this synthetic module first.
bioball
enabled auto-merge (squash)
July 10, 2026 23:51
bioball
added a commit
that referenced
this pull request
Jul 11, 2026
This fixes a regression where local members cannot be seen by the expression evaluator. Because variable are now parse-time resolved, this builds a truffle node by first constructing a synthetic module of all defined local members, and calls AstBuilder on this synthetic module first.
protobufel2
added a commit
to protobufel2/pkl
that referenced
this pull request
Jul 24, 2026
PR apple#1760 prepends a fixed-length preamble to expression input and compensates for it in StackTraceRenderer.renderSourceLine. That compensation subtracted the preamble length from endColumn unconditionally, but for a frame spanning multiple lines endColumn is sourceLine.length(), measured on the already-preamble-stripped line. The preamble was therefore subtracted twice, driving endColumn negative and making the caret-width String.repeat call throw IllegalArgumentException instead of rendering the error. Fold the preamble offset into the frame-derived column values, which are in original coordinates, and leave the stripped-length branch untouched. Same-line frames are unaffected.
protobufel2
added a commit
to protobufel2/pkl
that referenced
this pull request
Jul 24, 2026
PR apple#1760 prepends a fixed-length preamble to expression input and compensates for it in StackTraceRenderer.renderSourceLine. That compensation subtracted the preamble length from endColumn unconditionally, but for a frame spanning multiple lines endColumn is sourceLine.length(), measured on the already-preamble-stripped line. The preamble was therefore subtracted twice, driving endColumn negative and making the caret-width String.repeat call throw IllegalArgumentException instead of rendering the error. Fold the preamble offset into the frame-derived column values, which are in original coordinates, and leave the stripped-length branch untouched. Same-line frames are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a regression where local members cannot be seen by the expression evaluator.
Because variable are now parse-time resolved, this builds a truffle node by first constructing a synthetic module of all defined local members, and calls AstBuilder on this synthetic module first.
This moves some existing logic from ReplServer over to VmUtils.
Closes #1759