Repository navigation
Test that a tempfile name in a block, one-line if, ///, or #delimit ; is not reported undefined - #411
Merged
Merged
Conversation
… is not reported undefined (#62) Issue #62 reported a tempfile name flagged as an undefined local at a later save. The two lines alone never warned. The warning came when the tempfile sat inside quietly { } or capture { }, on a /// continuation, under #delimit ;, or in a one-line if. All of these are fixed on main (#376, #346, and earlier releases), so this adds only regression tests: 5 fail on v0.17.0 and 8 on v0.11.0. Co-authored-by: Claude Opus 5.5 <[email protected]>
Contributor
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.
Issue #62 said Sight reported a
tempfilename as an undefined local at a latersave "filename'". The two lines from the issue never warned on any version. The warning came when thetempfile` was in one of these places:quietly { }orcapture { }(fixed by Read the body of a quietly, capture, or bare { } block, so its locals and do calls count #376)///continuation (fixed by Parse Stata expressions, and stop splitting one statement into several AST nodes #346)#delimit ;(fixed between v0.11.0 and v0.14.0)if(fixed before v0.17.0)Main is already clean for all four, so this PR only adds regression tests for each case, plus one control that still warns.
Proof: the new file passes 10/10 on main. Copied into a v0.17.0 export, 5 tests fail; into v0.11.0, 8 fail. The full suite passes (9896 pass, 0 fail).
Refs #62
Reviewed with sol-loop: 1 round with gpt-6.2-sol and Claude Sonnet. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code).
Summary by CodeRabbit
tempfiledeclarations across brace blocks, programs, continued lines, semicolon-delimited sections, and one-line conditionals.filenamebefore using it does not produce a warning, while use without a declaration continues to produce a diagnostic.