Skip to content

Test that a tempfile name in a block, one-line if, ///, or #delimit ; is not reported undefined - #411

Merged
jbearak merged 1 commit into
mainfrom
fix/issue-62-tempfile-regression-tests
Nov 19, 2026
Merged

jbearak merged 1 commit into
mainfrom
fix/issue-62-tempfile-regression-tests

Conversation

@jbearak

@jbearak jbearak commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Issue #62 said Sight reported a tempfile name as an undefined local at a later save "filename'". The two lines from the issue never warned on any version. The warning came when the tempfile` was in one of these places:

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

  • Tests
    • Expanded regression coverage for diagnostics involving tempfile declarations across brace blocks, programs, continued lines, semicolon-delimited sections, and one-line conditionals.
    • Tests verify that declaring filename before using it does not produce a warning, while use without a declaration continues to produce a diagnostic.

… 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]>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds regression tests for undefined-macro diagnostics involving tempfile declarations in several syntax contexts. It also checks that an undeclared filename still produces a diagnostic.

Changes: Tempfile Diagnostic Coverage

Layer / File(s) Summary
Tempfile diagnostic regression tests
tests/repro_tempfile_undefined_local.test.ts
Tests check that a declared filename produces no warning across several syntax contexts. A negative case checks that an undeclared filename produces a diagnostic.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to c1e40

This change adds regression tests for undefined-macro diagnostics around tempfile declarations. It does not change runtime behavior, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: regression tests confirming that a tempfile name declared in a block, one-line if, /// continuation, or #delimit ; section is not reported as undefined. The raw summar…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: regression tests confirming that a tempfile name declared in a block, one-line if, /// continuation, or #delimit ; section is not reported as undefined. The raw summary and objectives confirm the PR adds only tests (plus one control case) and no behavior change, which the title reflects accurately. The title is a single sentence of 95 characters, slightly long but readable and specific.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: aa533e9c-9f4d-4442-9933-4f3385fd2efe
Commits

Reviewing files that changed from the base of the PR and between 706f657 and c1e40c0.

Files selected for processing: 1

  • tests/repro_tempfile_undefined_local.test.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@jbearak
jbearak merged commit 6d98b9b into main Nov 19, 2026
14 checks passed
@jbearak
jbearak deleted the fix/issue-62-tempfile-regression-tests branch November 19, 2026 12:07
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